10BC0 Add support for custom environment variables on the Nginx Controller … · nginx/kubernetes-ingress@d443d3a · GitHub
[go: up one dir, main page]

Skip to content

Commit d443d3a

Browse files
Add support for custom environment variables on the Nginx Controller container (#3326)
Co-authored-by 10BC0 : Shaun <s.odonovan@f5.com>
1 parent fccf1c4 commit d443d3a

File tree

6 files changed

+24
-0
lines changed

6 files changed

+24
-0
lines changed

deployments/helm-chart/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ Parameter | Description | Default
178178
`controller.tolerations` | The tolerations of the Ingress Controller pods. | []
179179
`controller.affinity` | The affinity of the Ingress Controller pods. | {}
180180
`controller.topologySpreadConstraints` | The topology spread constraints of the Ingress controller pods. | {}
181+
`controller.env` | The additional environment variables to be set on the Ingress Controller pods. | []
181182
`controller.volumes` | The volumes of the Ingress Controller pods. | []
182183
`controller.volumeMounts` | The volumeMounts of the Ingress Controller pods. | []
183184
`controller.initContainers` | InitContainers for the Ingress Controller pods. | []

deployments/helm-chart/templates/controller-daemonset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ spec:
136136
valueFrom:
137137
fieldRef:
138138
fieldPath: metadata.name
139+
{{- if .Values.controller.env }}
140+
{{ toYaml .Values.controller.env | indent 8 }}
141+
{{- end }}
139142
{{- if .Values.nginxServiceMesh.enable }}
140143
- name: POD_SERVICEACCOUNT
141144
valueFrom:

deployments/helm-chart/templates/controller-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ spec:
141141
valueFrom:
142142
fieldRef:
143143
fieldPath: metadata.name
144+
{{- if .Values.controller.env }}
145+
{{ toYaml .Values.controller.env | indent 8 }}
146+
{{- end }}
144147
{{- if .Values.nginxServiceMesh.enable }}
145148
- name: POD_SERVICEACCOUNT
146149
valueFrom:

deployments/helm-chart/values.schema.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,15 @@
460460
"title": "The topologySpreadConstraints Schema",
461461
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.25.4/_definitions.json#/definitions/io.k8s.api.core.v1.TopologySpreadConstraint"
462462
},
463+
"env": {
464+
"type": "array",
465+
"default": [],
466+
"title": "The env Schema",
467+
"items": {
468+
"type": "object",
469+
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.25.4/_definitions.json#/definitions/io.k8s.api.core.v1.EnvVar"
470+
}
471+
},
463472
"volumes": {
464473
"type": "array",
465474
"default": [],
@@ -1274,6 +1283,7 @@
12741283
"tolerations": [],
12751284
"affinity": {},
12761285
"topologySpreadConstraints": {},
1286+
"env": [],
12771287
"volumes": [],
12781288
"volumeMounts": [],
12791289
"initContainers": [],
@@ -1574,6 +1584,7 @@
15741584
"tolerations": [],
15751585
"affinity": {},
15761586
"topologySpreadConstraints": {},
1587+
"env": [],
15771588
"volumes": [],
15781589
"volumeMounts": [],
15791590
"initContainers": [],

deployments/helm-chart/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ controller:
153153
## The topology spread constraints of the Ingress controller pods.
154154
# topologySpreadConstraints: {}
155155

156+
## The additional environment variables to be set on the Ingress Controller pods.
157+
env: []
158+
# - name: MY_VAR
159+
# value: myvalue
160+
156161
## The volumes of the Ingress Controller pods.
157162
volumes: []
158163
# - name: extra-conf

docs/content/installation/installation-with-helm.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ The following tables lists the configurable parameters of the NGINX Ingress Cont
177177
|``controller.terminationGracePeriodSeconds`` | The termination grace period of the Ingress Controller pod. | 30 |
178178
|``controller.tolerations`` | The tolerations of the Ingress Controller pods. | [] |
179179
|``controller.affinity`` | The affinity of the Ingress Controller pods. | {} |
180+
|``controller.env`` | The additional environment variables to be set on the Ingress Controller pods. | []
180181
|``controller.volumes`` | The volumes of the Ingress Controller pods. | [] |
181182
|``controller.volumeMounts`` | The volumeMounts of the Ingress Controller pods. | [] |
182183
|``controller.initContainers`` | InitContainers for the Ingress Controller pods. | []

0 commit comments

Comments
 (0)
0