Skip to content

Commit d1dace0

Browse files
committed
add envFromSecrets for action, sensor, client, workflow, jobs pods
1 parent 631b517 commit d1dace0

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

templates/deployments.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,10 @@ spec:
749749
envFrom:
750750
- configMapRef:
751751
name: {{ .Release.Name }}-st2-urls
752+
{{- range .Values.st2workflowengine.envFromSecrets }}
753+
- secretRef:
754+
name: {{ . }}
755+
{{- end }}
752756
volumeMounts:
753757
{{- include "st2-config-volume-mounts" . | nindent 8 }}
754758
{{- if .Values.st2.datastore_crypto_key }}
@@ -1116,6 +1120,10 @@ spec:
11161120
envFrom:
11171121
- configMapRef:
11181122
name: {{ $.Release.Name }}-st2-urls
1123+
{{- range $sensor.envFromSecrets }}
1124+
- secretRef:
1125+
name: {{ . }}
1126+
{{- end }}
11191127
volumeMounts:
11201128
{{- include "st2-config-volume-mounts" $ | nindent 8 }}
11211129
{{- include "packs-volume-mounts" $ | nindent 8 }}
@@ -1250,6 +1258,10 @@ spec:
12501258
envFrom:
12511259
- configMapRef:
12521260
name: {{ .Release.Name }}-st2-urls
1261+
{{- range .Values.st2actionrunner.envFromSecrets }}
1262+
- secretRef:
1263+
name: {{ . }}
1264+
{{- end }}
12531265
volumeMounts:
12541266
{{- include "st2-config-volume-mounts" . | nindent 8 }}
12551267
- name: st2-ssh-key-vol
@@ -1506,6 +1518,10 @@ spec:
15061518
envFrom:
15071519
- configMapRef:
15081520
name: {{ .Release.Name }}-st2-urls
1521+
{{- range .Values.st2client.envFromSecrets }}
1522+
- secretRef:
1523+
name: {{ . }}
1524+
{{- end }}
15091525
volumeMounts:
15101526
{{- include "st2-config-volume-mounts" . | nindent 8 }}
15111527
{{- if .Values.st2.rbac.enabled }}

templates/jobs.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ spec:
5151
{{- if .Values.jobs.env }}
5252
env: {{- include "stackstorm-ha.customEnv" .Values.jobs | nindent 8 }}
5353
{{- end }}
54+
{{- if .Values.jobs.envFromSecrets }}
55+
envFrom:
56+
{{- range .Values.jobs.envFromSecrets }}
57+
- secretRef:
58+
name: {{ . }}
59+
{{- end }}
60+
{{- end }}
5461
volumeMounts:
5562
{{- include "st2-config-volume-mounts" . | nindent 8 }}
5663
- name: st2-rbac-roles-vol
@@ -178,6 +185,10 @@ spec:
178185
envFrom:
179186
- configMapRef:
180187
name: {{ .Release.Name }}-st2-urls
188+
{{- range .Values.jobs.envFromSecrets }}
189+
- secretRef:
190+
name: {{ . }}
191+
{{- end }}
181192
volumeMounts:
182193
- name: st2client-config-vol
183194
mountPath: /root/.st2/
@@ -291,6 +302,10 @@ spec:
291302
envFrom:
292303
- configMapRef:
293304
name: {{ .Release.Name }}-st2-urls
305+
{{- range .Values.jobs.envFromSecrets }}
306+
- secretRef:
307+
name: {{ . }}
308+
{{- end }}
294309
volumeMounts:
295310
{{- include "st2-config-volume-mounts" . | nindent 8 }}
296311
- name: st2client-config-vol
@@ -402,6 +417,13 @@ spec:
402417
{{- if .Values.jobs.env }}
403418
env: {{- include "stackstorm-ha.customEnv" .Values.jobs | nindent 8 }}
404419
{{- end }}
420+
{{- if .Values.jobs.envFromSecrets }}
421+
envFrom:
422+
{{- range .Values.jobs.envFromSecrets }}
423+
- secretRef:
424+
name: {{ . }}
425+
{{- end }}
426+
{{- end }}
405427
volumeMounts:
406428
{{- include "st2-config-volume-mounts" . | nindent 8 }}
407429
{{- include "packs-volume-mounts-for-register-job" . | nindent 8 }}

values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,8 @@ st2workflowengine:
454454
affinity: {}
455455
env: {}
456456
# HTTP_PROXY: http://proxy:1234
457+
## These named secrets (managed outside this chart) will be added to envFrom.
458+
envFromSecrets: []
457459
serviceAccount:
458460
attach: false
459461
# postStartScript is optional. It has the contents of a bash script.
@@ -546,6 +548,8 @@ st2actionrunner:
546548
# ip: 8.8.8.8
547549
env: {}
548550
# HTTP_PROXY: http://proxy:1234
551+
## These named secrets (managed outside this chart) will be added to envFrom.
552+
envFromSecrets: []
549553
serviceAccount:
550554
attach: false
551555
# postStartScript is optional. It has the contents of a bash script.
@@ -604,6 +608,8 @@ st2sensorcontainer:
604608
tolerations: []
605609
env: {}
606610
# HTTP_PROXY: http://proxy:1234
611+
## These named secrets (managed outside this chart) will be added to envFrom.
612+
envFromSecrets: []
607613
serviceAccount:
608614
attach: false
609615
# postStartScript is optional. It has the contents of a bash script.
@@ -621,6 +627,8 @@ st2sensorcontainer:
621627
st2client:
622628
env: {}
623629
# HTTP_PROXY: http://proxy:1234
630+
## These named secrets (managed outside this chart) will be added to envFrom.
631+
envFromSecrets: []
624632
annotations: {}
625633
# Override default image settings (for now, only tag can be overridden)
626634
image: {}
@@ -673,6 +681,7 @@ st2chatops:
673681
# Enable st2chatops (default: false)
674682
enabled: false
675683
# Custom hubot adapter ENV variables to pass through which will override st2chatops.env defaults.
684+
# These env vars get stored in a k8s secret loaded using envFrom.
676685
# See https://github.com/StackStorm/st2chatops/blob/master/st2chatops.env
677686
# for the full list of supported adapters and example ENV variables.
678687
# Note that Helm templating is supported for env values in this block!
@@ -741,6 +750,8 @@ jobs:
741750
affinity: {}
742751
env: {}
743752
# HTTP_PROXY: http://proxy:1234
753+
## These named secrets (managed outside this chart) will be added to envFrom.
754+
envFromSecrets: []
744755
#
745756
# Advanced controls to skip creating jobs.
746757
# This is useful in targeted upgrades with `--set`. Do not set this in values files.

0 commit comments

Comments
 (0)