Skip to content

Commit

Permalink
feat: add env vars from multiple secrets in Helm chart (#15426)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvoitko authored Jun 30, 2021
1 parent 149c5fd commit 8b3d08a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion helm/superset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ maintainers:
- name: craig-rueda
email: [email protected]
url: https://github.com/craig-rueda
version: 0.2.1
version: 0.3.0
dependencies:
- name: postgresql
version: 10.2.0
Expand Down
6 changes: 5 additions & 1 deletion helm/superset/templates/deployment-beat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ spec:
env:
- name: "SUPERSET_PORT"
value: {{ .Values.service.port | quote}}
{{ if .Values.extraEnv }}
{{- if .Values.extraEnv }}
{{- range $key, $value := .Values.extraEnv }}
- name: {{ $key | quote}}
value: {{ $value | quote }}
Expand All @@ -78,6 +78,10 @@ spec:
envFrom:
- secretRef:
name: {{ tpl .Values.envFromSecret . | quote }}
{{- range .Values.envFromSecrets }}
- secretRef:
name: {{ tpl . $ | quote }}
{{- end }}
volumeMounts:
- name: superset-config
mountPath: {{ .Values.configMountPath | quote }}
Expand Down
6 changes: 5 additions & 1 deletion helm/superset/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ spec:
env:
- name: "SUPERSET_PORT"
value: {{ .Values.service.port | quote}}
{{ if .Values.extraEnv }}
{{- if .Values.extraEnv }}
{{- range $key, $value := .Values.extraEnv }}
- name: {{ $key | quote}}
value: {{ $value | quote }}
Expand All @@ -79,6 +79,10 @@ spec:
envFrom:
- secretRef:
name: {{ tpl .Values.envFromSecret . | quote }}
{{- range .Values.envFromSecrets }}
- secretRef:
name: {{ tpl . $ | quote }}
{{- end }}
volumeMounts:
- name: superset-config
mountPath: {{ .Values.configMountPath | quote }}
Expand Down
6 changes: 5 additions & 1 deletion helm/superset/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
env:
- name: "SUPERSET_PORT"
value: {{ .Values.service.port | quote}}
{{ if .Values.extraEnv }}
{{- if .Values.extraEnv }}
{{- range $key, $value := .Values.extraEnv }}
- name: {{ $key | quote}}
value: {{ $value | quote }}
Expand All @@ -82,6 +82,10 @@ spec:
envFrom:
- secretRef:
name: {{ tpl .Values.envFromSecret . | quote }}
{{- range .Values.envFromSecrets }}
- secretRef:
name: {{ tpl . $ | quote }}
{{- end }}
volumeMounts:
- name: superset-config
mountPath: {{ .Values.configMountPath | quote }}
Expand Down
6 changes: 5 additions & 1 deletion helm/superset/templates/init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@ spec:
envFrom:
- secretRef:
name: {{ tpl .Values.envFromSecret . }}
{{- range .Values.envFromSecrets }}
- secretRef:
name: {{ tpl . $ }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: superset-config
mountPath: {{ .Values.configMountPath | quote }}
readOnly: true
{{ if .Values.extraConfigs }}
{{- if .Values.extraConfigs }}
- name: superset-extra-config
mountPath: {{ .Values.extraConfigMountPath | quote }}
readOnly: true
Expand Down
2 changes: 2 additions & 0 deletions helm/superset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ configFromSecret: '{{ template "superset.fullname" . }}-config'
## This can be useful for secret keys, etc.
##
envFromSecret: '{{ template "superset.fullname" . }}-env'
## This can be a list of template strings
envFromSecrets: []

## Extra environment variables that will be passed into pods
##
Expand Down

0 comments on commit 8b3d08a

Please sign in to comment.