Skip to content

Commit

Permalink
use list of secrets/configmaps for envFrom
Browse files Browse the repository at this point in the history
  • Loading branch information
SmaineTF1 committed Jul 3, 2023
1 parent e144372 commit 2fb237b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 18 deletions.
24 changes: 21 additions & 3 deletions templates/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,33 @@ spec:
{{- if or $.Values.server.additionalEnv $serviceValues.additionalEnv }}
{{- toYaml (default $.Values.server.additionalEnv $serviceValues.additionalEnv) | nindent 12 }}
{{- end }}
{{- if or $serviceValues.additionalEnvCM $serviceValues.additionalEnvSecret }}
{{- if or $.Values.server.additionalEnvCM $.Values.server.additionalEnvSecret }}
envFrom:
{{- if $.Values.server.additionalEnvCM }}
{{- range $.Values.server.additionalEnvCM }}
- configMapRef:
name: {{ . }}
{{- end }}
{{- end }}
{{- if $.Values.server.additionalEnvSecret }}
{{- range $.Values.server.additionalEnvSecret }}
- secretRef:
name: {{ . }}
{{- end }}
{{- end }}
{{- else if or $serviceValues.additionalEnvCM $serviceValues.additionalEnvSecret }}
envFrom:
{{- if $serviceValues.additionalEnvCM }}
{{- range $serviceValues.additionalEnvCM }}
- configMapRef:
name: {{ $serviceValues.additionalEnvCM }}
name: {{ . }}
{{- end }}
{{- end }}
{{- if $serviceValues.additionalEnvSecret }}
{{- range $serviceValues.additionalEnvSecret }}
- secretRef:
name: {{ $serviceValues.additionalEnvSecret }}
name: {{ . }}
{{- end }}
{{- end }}
{{- end }}
ports:
Expand Down
8 changes: 6 additions & 2 deletions templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@ spec:
{{- if or .Values.web.additionalEnvCM .Values.web.additionalEnvSecret }}
envFrom:
{{- if .Values.web.additionalEnvCM }}
{{- range .Values.web.additionalEnvCM }}
- configMapRef:
name: {{ .Values.web.additionalEnvCM }}
name: {{ . }}
{{- end }}
{{- end }}
{{- if .Values.web.additionalEnvSecret }}
{{- range .Values.web.additionalEnvSecret }}
- secretRef:
name: {{ .Values.web.additionalEnvSecret }}
name: {{ . }}
{{- end }}
{{- end }}
{{- end }}
ports:
Expand Down
28 changes: 15 additions & 13 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ server:
additionalVolumes: []
additionalVolumeMounts: []
additionalEnv: []
additionalEnvCM: ""
additionalEnvSecret: ""
additionalEnvCM: []
additionalEnvSecret: []
securityContext:
fsGroup: 1000
runAsUser: 1000
Expand Down Expand Up @@ -185,8 +185,8 @@ server:
tolerations: []
affinity: {}
additionalEnv: []
additionalEnvCM: ""
additionalEnvSecret: ""
additionalEnvCM: []
additionalEnvSecret: []
containerSecurityContext: {}
topologySpreadConstraints: {}
podDisruptionBudget: {}
Expand All @@ -209,8 +209,8 @@ server:
tolerations: []
affinity: {}
additionalEnv: []
additionalEnvCM: ""
additionalEnvSecret: ""
additionalEnvCM: []
additionalEnvSecret: []
containerSecurityContext: {}
topologySpreadConstraints: {}
podDisruptionBudget: {}
Expand All @@ -233,8 +233,8 @@ server:
tolerations: []
affinity: {}
additionalEnv: []
additionalEnvCM: ""
additionalEnvSecret: ""
additionalEnvCM: []
additionalEnvSecret: []
containerSecurityContext: {}
topologySpreadConstraints: {}
podDisruptionBudget: {}
Expand All @@ -257,8 +257,8 @@ server:
tolerations: []
affinity: {}
additionalEnv: []
additionalEnvCM: ""
additionalEnvSecret: ""
additionalEnvCM: []
additionalEnvSecret: []
containerSecurityContext: {}
topologySpreadConstraints: {}
podDisruptionBudget: {}
Expand All @@ -280,8 +280,8 @@ admintools:
tolerations: []
affinity: {}
additionalEnv: []
additionalEnvCM: ""
additionalEnvSecret: ""
additionalEnvCM: []
additionalEnvSecret: []
resources: {}
containerSecurityContext: {}
securityContext: {}
Expand Down Expand Up @@ -350,9 +350,11 @@ web:
affinity: {}

additionalEnv: []
additionalEnvCM: []
additionalEnvSecret: []

containerSecurityContext: {}

securityContext: {}

schema:
Expand Down

0 comments on commit 2fb237b

Please sign in to comment.