Skip to content

Commit

Permalink
Add support for custom environment variables on the Nginx Controller …
Browse files Browse the repository at this point in the history
…container (#3326)

Co-authored-by: Shaun <[email protected]>
  • Loading branch information
AaronShiels and shaun-nx authored Jan 24, 2023
1 parent fccf1c4 commit d443d3a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions deployments/helm-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Parameter | Description | Default
`controller.tolerations` | The tolerations of the Ingress Controller pods. | []
`controller.affinity` | The affinity of the Ingress Controller pods. | {}
`controller.topologySpreadConstraints` | The topology spread constraints of the Ingress controller pods. | {}
`controller.env` | The additional environment variables to be set on the Ingress Controller pods. | []
`controller.volumes` | The volumes of the Ingress Controller pods. | []
`controller.volumeMounts` | The volumeMounts of the Ingress Controller pods. | []
`controller.initContainers` | InitContainers for the Ingress Controller pods. | []
Expand Down
3 changes: 3 additions & 0 deletions deployments/helm-chart/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
{{- if .Values.controller.env }}
{{ toYaml .Values.controller.env | indent 8 }}
{{- end }}
{{- if .Values.nginxServiceMesh.enable }}
- name: POD_SERVICEACCOUNT
valueFrom:
Expand Down
3 changes: 3 additions & 0 deletions deployments/helm-chart/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
{{- if .Values.controller.env }}
{{ toYaml .Values.controller.env | indent 8 }}
{{- end }}
{{- if .Values.nginxServiceMesh.enable }}
- name: POD_SERVICEACCOUNT
valueFrom:
Expand Down
11 changes: 11 additions & 0 deletions deployments/helm-chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,15 @@
"title": "The topologySpreadConstraints Schema",
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.25.4/_definitions.json#/definitions/io.k8s.api.core.v1.TopologySpreadConstraint"
},
"env": {
"type": "array",
"default": [],
"title": "The env Schema",
"items": {
"type": "object",
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.25.4/_definitions.json#/definitions/io.k8s.api.core.v1.EnvVar"
}
},
"volumes": {
"type": "array",
"default": [],
Expand Down Expand Up @@ -1274,6 +1283,7 @@
"tolerations": [],
"affinity": {},
"topologySpreadConstraints": {},
"env": [],
"volumes": [],
"volumeMounts": [],
"initContainers": [],
Expand Down Expand Up @@ -1574,6 +1584,7 @@
"tolerations": [],
"affinity": {},
"topologySpreadConstraints": {},
"env": [],
"volumes": [],
"volumeMounts": [],
"initContainers": [],
Expand Down
5 changes: 5 additions & 0 deletions deployments/helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ controller:
## The topology spread constraints of the Ingress controller pods.
# topologySpreadConstraints: {}

## The additional environment variables to be set on the Ingress Controller pods.
env: []
# - name: MY_VAR
# value: myvalue

## The volumes of the Ingress Controller pods.
volumes: []
# - name: extra-conf
Expand Down
1 change: 1 addition & 0 deletions docs/content/installation/installation-with-helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ The following tables lists the configurable parameters of the NGINX Ingress Cont
|``controller.terminationGracePeriodSeconds`` | The termination grace period of the Ingress Controller pod. | 30 |
|``controller.tolerations`` | The tolerations of the Ingress Controller pods. | [] |
|``controller.affinity`` | The affinity of the Ingress Controller pods. | {} |
|``controller.env`` | The additional environment variables to be set on the Ingress Controller pods. | []
|``controller.volumes`` | The volumes of the Ingress Controller pods. | [] |
|``controller.volumeMounts`` | The volumeMounts of the Ingress Controller pods. | [] |
|``controller.initContainers`` | InitContainers for the Ingress Controller pods. | []
Expand Down

0 comments on commit d443d3a

Please sign in to comment.