[stable/nginx-ingress] Custom NGINX template support (#2341)

Many NGINX configuration parameters cannot be overridden with the
nginx-ingress Helm chart. With this change, a custom nginx.tmpl
template can be provided, which allows for any configuration value to
be changed.
This commit is contained in:
David Huie
2017-11-27 08:53:31 -08:00
committed by Vic Iglesias
parent ae7d78aa62
commit 20c6c76ea8
4 changed files with 37 additions and 0 deletions
+2
View File
@@ -82,6 +82,8 @@ Parameter | Description | Default
`controller.stats.service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""`
`controller.stats.service.loadBalancerSourceRanges` | list of IP CIDRs allowed access to load balancer (if supported) | `[]`
`controller.stats.service.type` | type of controller stats service to create | `ClusterIP`
`controller.customTemplate.configMapName` | configMap containing a custom nginx template | `""`
`controller.customTemplate.configMapKey` | configMap key containing the nginx template | `""`
`defaultBackend.name` | name of the default backend component | `default-backend`
`defaultBackend.image.repository` | default backend container image repository | `gcr.io/google_containers/defaultbackend`
`defaultBackend.image.tag` | default backend container image tag | `1.3`
@@ -102,6 +102,12 @@ spec:
path: /healthz
port: 10254
scheme: HTTP
{{- if .Values.controller.customTemplate.configMapName }}
volumeMounts:
- mountPath: /etc/nginx/template
name: nginx-template-volume
readOnly: true
{{- end }}
resources:
{{ toYaml .Values.controller.resources | indent 12 }}
{{- if .Values.controller.stats.enabled }}
@@ -135,6 +141,15 @@ spec:
{{- end }}
serviceAccountName: {{ if .Values.rbac.create }}{{ template "nginx-ingress.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }}
terminationGracePeriodSeconds: 60
{{- if .Values.controller.customTemplate.configMapName }}
volumes:
- name: nginx-template-volume
configMap:
name: {{ .Values.controller.customTemplate.configMapName }}
items:
- key: {{ .Values.controller.customTemplate.configMapKey }}
path: nginx.tmpl
{{- end }}
updateStrategy:
{{ toYaml .Values.controller.updateStrategy | indent 4 }}
{{- end }}
@@ -108,6 +108,12 @@ spec:
path: /healthz
port: 10254
scheme: HTTP
{{- if .Values.controller.customTemplate.configMapName }}
volumeMounts:
- mountPath: /etc/nginx/template
name: nginx-template-volume
readOnly: true
{{- end }}
resources:
{{ toYaml .Values.controller.resources | indent 12 }}
{{- if .Values.controller.stats.enabled }}
@@ -141,4 +147,13 @@ spec:
{{- end }}
serviceAccountName: {{ if .Values.rbac.create }}{{ template "nginx-ingress.fullname" . }}{{ else }}"{{ .Values.rbac.serviceAccountName }}"{{ end }}
terminationGracePeriodSeconds: 60
{{- if .Values.controller.customTemplate.configMapName }}
volumes:
- name: nginx-template-volume
configMap:
name: {{ .Values.controller.customTemplate.configMapName }}
items:
- key: {{ .Values.controller.customTemplate.configMapKey }}
path: nginx.tmpl
{{- end }}
{{- end }}
+5
View File
@@ -93,6 +93,11 @@ controller:
# cpu: 100m
# memory: 64Mi
## Override NGINX template
customTemplate:
configMapName: ""
configMapKey: ""
service:
annotations: {}
clusterIP: ""