Commit db0eddd6 authored by Jason Greathouse's avatar Jason Greathouse Committed by Alena Prokharchyk
Browse files

ingress config snippet

No related merge requests found
Showing with 30 additions and 0 deletions
+30 -0
......@@ -18,3 +18,8 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
# Render Values in configurationSnippet
{{- define "configurationSnippet" -}}
{{- tpl (.Values.ingress.configurationSnippet) . -}}
{{- end -}}
......@@ -8,6 +8,10 @@ metadata:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
annotations:
{{- if .Values.ingress.configurationSnippet }}
nginx.ingress.kubernetes.io/configuration-snippet: |
{{ template "configurationSnippet" . }}
{{- end }}
{{- if eq .Values.tls "external" }}
nginx.ingress.kubernetes.io/ssl-redirect: "false" # turn off ssl redirect for external.
{{- else }}
......
......@@ -47,3 +47,19 @@ tests:
hosts:
- test
secretName: tls-rancher-ingress
- it: should set static X-Forwarded-Host header
set:
hostname: host.example.com
ingress:
configurationSnippet: |
more_set_input_headers X-Forwarded-Host {{ .Values.hostname }};
asserts:
- equal:
path: metadata.annotations
value:
certmanager.k8s.io/issuer: RELEASE-NAME-rancher
nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_input_headers X-Forwarded-Host host.example.com;
......@@ -49,6 +49,11 @@ ingress:
nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
# configurationSnippet - Add additional Nginx configuration. This example statically sets a header on the ingress.
# configurationSnippet: |
# more_set_input_headers X-Forwarded-Host {{ .Values.hostname }};
tls:
# options: rancher, letsEncrypt, secret
source: rancher
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment