Skip to content

Commit

Permalink
support extraEnvs for job resources in helm chart (#8545)
Browse files Browse the repository at this point in the history
* support extraEnvs for job resources in helm chart

Signed-off-by: Li, Eric <Xiannan.li@fmr.com>

* Update helm doc

* Update helm doc

* Updated helm doc - add controller.admissionWebhooks.extraEnvs

* Added some test data for webhook controller.admissionWebhooks.extraEnvs

* added new line at the end of deployment-webhook-extraEnvs-values.yaml

* Fixed helm chart test issue
  • Loading branch information
Eric84626 committed Jun 21, 2022
1 parent 8bf7799 commit 7806159
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/ingress-nginx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ Kubernetes: `>=1.19.0-0`
| controller.admissionWebhooks.createSecretJob.resources | object | `{}` | |
| controller.admissionWebhooks.enabled | bool | `true` | |
| controller.admissionWebhooks.existingPsp | string | `""` | Use an existing PSP instead of creating one |
| controller.admissionWebhooks.extraEnvs | list | `[]` | Additional environment variables to set |
| controller.admissionWebhooks.failurePolicy | string | `"Fail"` | |
| controller.admissionWebhooks.key | string | `"/usr/local/certificates/key"` | |
| controller.admissionWebhooks.labels | object | `{}` | Labels to be added to admission webhooks |
Expand Down
12 changes: 12 additions & 0 deletions charts/ingress-nginx/ci/deployment-webhook-extraEnvs-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
controller:
service:
type: ClusterIP
admissionWebhooks:
enabled: true
extraEnvs:
- name: FOO
value: foo
- name: TEST
value: test
patch:
enabled: true
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.controller.admissionWebhooks.extraEnvs }}
{{- toYaml .Values.controller.admissionWebhooks.extraEnvs | nindent 12 }}
{{- end }}
securityContext:
allowPrivilegeEscalation: false
{{- if .Values.controller.admissionWebhooks.createSecretJob.resources }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.controller.admissionWebhooks.extraEnvs }}
{{- toYaml .Values.controller.admissionWebhooks.extraEnvs | nindent 12 }}
{{- end }}
securityContext:
allowPrivilegeEscalation: false
{{- if .Values.controller.admissionWebhooks.patchWebhookJob.resources }}
Expand Down
8 changes: 8 additions & 0 deletions charts/ingress-nginx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,14 @@ controller:
## These annotations will be added to the ValidatingWebhookConfiguration and
## the Jobs Spec of the admission webhooks.
enabled: true
# -- Additional environment variables to set
extraEnvs: []
# extraEnvs:
# - name: FOO
# valueFrom:
# secretKeyRef:
# key: FOO
# name: secret-resource
failurePolicy: Fail
# timeoutSeconds: 10
port: 8443
Expand Down

0 comments on commit 7806159

Please sign in to comment.