Skip to content

Commit 8c1e1e3

Browse files
authored
Merge pull request #70 from ndustrialio/support-complex-extra-env
fix: support complex extra env var map
2 parents 2273256 + a253f8c commit 8c1e1e3

File tree

15 files changed

+60
-11
lines changed

15 files changed

+60
-11
lines changed

examples/deployment/cert-manager.yml

+8
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,11 @@ externalSecrets:
6868
tenant: test-tenant
6969
updateStrategy:
7070
type: Recreate
71+
72+
extraEnvVarsMap:
73+
TEST: value
74+
TEST_SECRET:
75+
valueFrom:
76+
secretKeyRef:
77+
name: my-custom-secret-name
78+
key: test

ndustrial/cronjob/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ maintainers:
1414
1515
name: DevOps
1616
# Please make sure that version and appVersion are always the same.
17-
version: 0.1.29
18-
appVersion: 0.1.29
17+
version: 0.1.30
18+
appVersion: 0.1.30

ndustrial/cronjob/templates/cronjob.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,13 @@ spec:
125125
{{- if .Values.extraEnvVarsMap }}
126126
{{- range $key, $val := .Values.extraEnvVarsMap }}
127127
- name: {{ $key }}
128+
{{- if (kindIs "map" $val ) }}
129+
{{- include "nio-common.tplvalues.render" (dict "value" $val "context" $) | nindent 18 }}
130+
{{- else }}
128131
value: {{ include "nio-common.tplvalues.render" (dict "value" $val "context" $) | quote }}
129132
{{- end }}
130133
{{- end }}
134+
{{- end }}
131135
{{- if .Values.datadog }}
132136
{{- include "nio-common.datadog.envs" (dict "value" .Values.datadog "context" $) | nindent 16 }}
133137
{{- end }}

ndustrial/cronjob/values.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,15 @@ shareProcessNamespace: false
162162
##
163163
extraEnvVars: []
164164

165-
## @param extraEnvVarsMap Add extra environment variables to the Deployment container
165+
## @param extraEnvVarsMap Add extra environment variables to the Deployment container. Can be a single string or a valid environment mapping
166166
## E.g:
167167
## extraEnvVarsMap:
168168
## FOO: "bar"
169+
## FOO_SECRET:
170+
## valueFrom:
171+
## secretKeyRef:
172+
## name: secret
173+
## key: test
169174
##
170175
extraEnvVarsMap: {}
171176

ndustrial/daemonset/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ maintainers:
1313
1414
name: DevOps
1515
# Please make sure that version and appVersion are always the same.
16-
version: 0.1.7
17-
appVersion: 0.1.7
16+
version: 0.1.8
17+
appVersion: 0.1.8

ndustrial/daemonset/templates/daemonset.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,13 @@ spec:
9090
{{- if .Values.extraEnvVarsMap }}
9191
{{- range $key, $val := .Values.extraEnvVarsMap }}
9292
- name: {{ $key }}
93+
{{- if (kindIs "map" $val ) }}
94+
{{- include "nio-common.tplvalues.render" (dict "value" $val "context" $) | nindent 14 }}
95+
{{- else }}
9396
value: {{ include "nio-common.tplvalues.render" (dict "value" $val "context" $) | quote }}
9497
{{- end }}
9598
{{- end }}
99+
{{- end }}
96100
- name: POD_NAMESPACE
97101
valueFrom:
98102
fieldRef:

ndustrial/daemonset/values.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,11 @@ extraEnvVars: []
340340
## E.g:
341341
## extraEnvVarsMap:
342342
## FOO: "bar"
343+
## FOO_SECRET:
344+
## valueFrom:
345+
## secretKeyRef:
346+
## name: secret
347+
## key: test
343348
##
344349
extraEnvVarsMap: {}
345350

ndustrial/deployment/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ maintainers:
1313
1414
name: DevOps
1515
# Please make sure that version and appVersion are always the same.
16-
version: 0.1.63
17-
appVersion: 0.1.63
16+
version: 0.1.64
17+
appVersion: 0.1.64

ndustrial/deployment/templates/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,13 @@ spec:
104104
{{- if .Values.extraEnvVarsMap }}
105105
{{- range $key, $val := .Values.extraEnvVarsMap }}
106106
- name: {{ $key }}
107+
{{- if (kindIs "map" $val ) }}
108+
{{- include "nio-common.tplvalues.render" (dict "value" $val "context" $) | nindent 14 }}
109+
{{- else }}
107110
value: {{ include "nio-common.tplvalues.render" (dict "value" $val "context" $) | quote }}
108111
{{- end }}
109112
{{- end }}
113+
{{- end }}
110114
- name: POD_NAMESPACE
111115
valueFrom:
112116
fieldRef:

ndustrial/deployment/values.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,11 @@ extraEnvVars: []
389389
## E.g:
390390
## extraEnvVarsMap:
391391
## FOO: "bar"
392+
## FOO_SECRET:
393+
## valueFrom:
394+
## secretKeyRef:
395+
## name: secret
396+
## key: test
392397
##
393398
extraEnvVarsMap: {}
394399

ndustrial/nio-api/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ maintainers:
1313
1414
name: DevOps
1515
# Please make sure that version and appVersion are always the same.
16-
version: 1.0.11
17-
appVersion: 1.0.11
16+
version: 1.0.12
17+
appVersion: 1.0.12

ndustrial/nio-api/values.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,11 @@ extraEnvVars: []
365365
## E.g:
366366
## extraEnvVarsMap:
367367
## FOO: "bar"
368+
## FOO_SECRET:
369+
## valueFrom:
370+
## secretKeyRef:
371+
## name: secret
372+
## key: test
368373
##
369374
extraEnvVarsMap: {}
370375
## @param extraEnvVarsCM Name of existing ConfigMap containing extra env vars

ndustrial/statefulset/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ maintainers:
1212
1313
name: DevOps
1414
# Please make sure that version and appVersion are always the same.
15-
version: 0.1.39
16-
appVersion: 0.1.39
15+
version: 0.1.40
16+
appVersion: 0.1.40

ndustrial/statefulset/templates/statefuleset.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,13 @@ spec:
105105
{{- if .Values.extraEnvVarsMap }}
106106
{{- range $key, $val := .Values.extraEnvVarsMap }}
107107
- name: {{ $key }}
108+
{{- if (kindIs "map" $val ) }}
109+
{{- include "nio-common.tplvalues.render" (dict "value" $val "context" $) | nindent 14 }}
110+
{{- else }}
108111
value: {{ include "nio-common.tplvalues.render" (dict "value" $val "context" $) | quote }}
109112
{{- end }}
110113
{{- end }}
114+
{{- end }}
111115
{{- if .Values.datadog }}
112116
{{- include "nio-common.datadog.envs" (dict "value" .Values.datadog "context" $) | nindent 12 }}
113117
{{- end }}

ndustrial/statefulset/values.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,11 @@ extraEnvVars: []
363363
## E.g:
364364
## extraEnvVarsMap:
365365
## FOO: "bar"
366+
## FOO_SECRET:
367+
## valueFrom:
368+
## secretKeyRef:
369+
## name: secret
370+
## key: test
366371
##
367372
extraEnvVarsMap: {}
368373

0 commit comments

Comments
 (0)