diff --git a/stable/nginx-ingress/README.md b/stable/nginx-ingress/README.md index 50fb4908ba..c8d0d25f1d 100644 --- a/stable/nginx-ingress/README.md +++ b/stable/nginx-ingress/README.md @@ -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` diff --git a/stable/nginx-ingress/templates/controller-daemonset.yaml b/stable/nginx-ingress/templates/controller-daemonset.yaml index 15ced826f5..ecc5c8aa84 100644 --- a/stable/nginx-ingress/templates/controller-daemonset.yaml +++ b/stable/nginx-ingress/templates/controller-daemonset.yaml @@ -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 }} diff --git a/stable/nginx-ingress/templates/controller-deployment.yaml b/stable/nginx-ingress/templates/controller-deployment.yaml index d827988e9a..b48af7c679 100644 --- a/stable/nginx-ingress/templates/controller-deployment.yaml +++ b/stable/nginx-ingress/templates/controller-deployment.yaml @@ -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 }} diff --git a/stable/nginx-ingress/values.yaml b/stable/nginx-ingress/values.yaml index 2e3989e821..1406fd9c3e 100644 --- a/stable/nginx-ingress/values.yaml +++ b/stable/nginx-ingress/values.yaml @@ -93,6 +93,11 @@ controller: # cpu: 100m # memory: 64Mi + ## Override NGINX template + customTemplate: + configMapName: "" + configMapKey: "" + service: annotations: {} clusterIP: ""