Skip to content

Commit

Permalink
Merge pull request #70 from ndustrialio/support-complex-extra-env
Browse files Browse the repository at this point in the history
fix: support complex extra env var map
  • Loading branch information
mgagliardo91 authored Oct 2, 2024
2 parents 2273256 + a253f8c commit 8c1e1e3
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 11 deletions.
8 changes: 8 additions & 0 deletions examples/deployment/cert-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,11 @@ externalSecrets:
tenant: test-tenant
updateStrategy:
type: Recreate

extraEnvVarsMap:
TEST: value
TEST_SECRET:
valueFrom:
secretKeyRef:
name: my-custom-secret-name
key: test
4 changes: 2 additions & 2 deletions ndustrial/cronjob/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ maintainers:
- email: [email protected]
name: DevOps
# Please make sure that version and appVersion are always the same.
version: 0.1.29
appVersion: 0.1.29
version: 0.1.30
appVersion: 0.1.30
4 changes: 4 additions & 0 deletions ndustrial/cronjob/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,13 @@ spec:
{{- if .Values.extraEnvVarsMap }}
{{- range $key, $val := .Values.extraEnvVarsMap }}
- name: {{ $key }}
{{- if (kindIs "map" $val ) }}
{{- include "nio-common.tplvalues.render" (dict "value" $val "context" $) | nindent 18 }}
{{- else }}
value: {{ include "nio-common.tplvalues.render" (dict "value" $val "context" $) | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.datadog }}
{{- include "nio-common.datadog.envs" (dict "value" .Values.datadog "context" $) | nindent 16 }}
{{- end }}
Expand Down
7 changes: 6 additions & 1 deletion ndustrial/cronjob/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,15 @@ shareProcessNamespace: false
##
extraEnvVars: []

## @param extraEnvVarsMap Add extra environment variables to the Deployment container
## @param extraEnvVarsMap Add extra environment variables to the Deployment container. Can be a single string or a valid environment mapping
## E.g:
## extraEnvVarsMap:
## FOO: "bar"
## FOO_SECRET:
## valueFrom:
## secretKeyRef:
## name: secret
## key: test
##
extraEnvVarsMap: {}

Expand Down
4 changes: 2 additions & 2 deletions ndustrial/daemonset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ maintainers:
- email: [email protected]
name: DevOps
# Please make sure that version and appVersion are always the same.
version: 0.1.7
appVersion: 0.1.7
version: 0.1.8
appVersion: 0.1.8
4 changes: 4 additions & 0 deletions ndustrial/daemonset/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,13 @@ spec:
{{- if .Values.extraEnvVarsMap }}
{{- range $key, $val := .Values.extraEnvVarsMap }}
- name: {{ $key }}
{{- if (kindIs "map" $val ) }}
{{- include "nio-common.tplvalues.render" (dict "value" $val "context" $) | nindent 14 }}
{{- else }}
value: {{ include "nio-common.tplvalues.render" (dict "value" $val "context" $) | quote }}
{{- end }}
{{- end }}
{{- end }}
- name: POD_NAMESPACE
valueFrom:
fieldRef:
Expand Down
5 changes: 5 additions & 0 deletions ndustrial/daemonset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ extraEnvVars: []
## E.g:
## extraEnvVarsMap:
## FOO: "bar"
## FOO_SECRET:
## valueFrom:
## secretKeyRef:
## name: secret
## key: test
##
extraEnvVarsMap: {}

Expand Down
4 changes: 2 additions & 2 deletions ndustrial/deployment/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ maintainers:
- email: [email protected]
name: DevOps
# Please make sure that version and appVersion are always the same.
version: 0.1.63
appVersion: 0.1.63
version: 0.1.64
appVersion: 0.1.64
4 changes: 4 additions & 0 deletions ndustrial/deployment/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,13 @@ spec:
{{- if .Values.extraEnvVarsMap }}
{{- range $key, $val := .Values.extraEnvVarsMap }}
- name: {{ $key }}
{{- if (kindIs "map" $val ) }}
{{- include "nio-common.tplvalues.render" (dict "value" $val "context" $) | nindent 14 }}
{{- else }}
value: {{ include "nio-common.tplvalues.render" (dict "value" $val "context" $) | quote }}
{{- end }}
{{- end }}
{{- end }}
- name: POD_NAMESPACE
valueFrom:
fieldRef:
Expand Down
5 changes: 5 additions & 0 deletions ndustrial/deployment/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ extraEnvVars: []
## E.g:
## extraEnvVarsMap:
## FOO: "bar"
## FOO_SECRET:
## valueFrom:
## secretKeyRef:
## name: secret
## key: test
##
extraEnvVarsMap: {}

Expand Down
4 changes: 2 additions & 2 deletions ndustrial/nio-api/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ maintainers:
- email: [email protected]
name: DevOps
# Please make sure that version and appVersion are always the same.
version: 1.0.11
appVersion: 1.0.11
version: 1.0.12
appVersion: 1.0.12
5 changes: 5 additions & 0 deletions ndustrial/nio-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ extraEnvVars: []
## E.g:
## extraEnvVarsMap:
## FOO: "bar"
## FOO_SECRET:
## valueFrom:
## secretKeyRef:
## name: secret
## key: test
##
extraEnvVarsMap: {}
## @param extraEnvVarsCM Name of existing ConfigMap containing extra env vars
Expand Down
4 changes: 2 additions & 2 deletions ndustrial/statefulset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ maintainers:
- email: [email protected]
name: DevOps
# Please make sure that version and appVersion are always the same.
version: 0.1.39
appVersion: 0.1.39
version: 0.1.40
appVersion: 0.1.40
4 changes: 4 additions & 0 deletions ndustrial/statefulset/templates/statefuleset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,13 @@ spec:
{{- if .Values.extraEnvVarsMap }}
{{- range $key, $val := .Values.extraEnvVarsMap }}
- name: {{ $key }}
{{- if (kindIs "map" $val ) }}
{{- include "nio-common.tplvalues.render" (dict "value" $val "context" $) | nindent 14 }}
{{- else }}
value: {{ include "nio-common.tplvalues.render" (dict "value" $val "context" $) | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.datadog }}
{{- include "nio-common.datadog.envs" (dict "value" .Values.datadog "context" $) | nindent 12 }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions ndustrial/statefulset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,11 @@ extraEnvVars: []
## E.g:
## extraEnvVarsMap:
## FOO: "bar"
## FOO_SECRET:
## valueFrom:
## secretKeyRef:
## name: secret
## key: test
##
extraEnvVarsMap: {}

Expand Down

0 comments on commit 8c1e1e3

Please sign in to comment.