Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom environment variables on the Nginx Controller container #3326

Merged
merged 5 commits into from Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions deployments/helm-chart/README.md
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
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
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
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 @@ -1276,6 +1285,7 @@
"tolerations": [],
"affinity": {},
"topologySpreadConstraints": {},
"env": [],
"volumes": [],
"volumeMounts": [],
"initContainers": [],
Expand Down Expand Up @@ -1576,6 +1586,7 @@
"tolerations": [],
"affinity": {},
"topologySpreadConstraints": {},
"env": [],
"volumes": [],
"volumeMounts": [],
"initContainers": [],
Expand Down
5 changes: 5 additions & 0 deletions deployments/helm-chart/values.yaml
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
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