Skip to content

Commit 74f8c6e

Browse files
authored
Merge branch 'master' into optional_secret_config
2 parents c3f49eb + f47b7b1 commit 74f8c6e

File tree

6 files changed

+686
-26
lines changed

6 files changed

+686
-26
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
## In Development
44
* Temporary workaround for #311 to use previous bitnami index from: https://github.com/bitnami/charts/issues/10539 (#312 #318) (by @0xhaven)
55
* Refactor label definitions to be more consistent by building labels and label selectors in partial helper templates. (#299) (by @cognifloyd)
6-
* Use the correct `apiVersion` for `Ingress` to add support for Kubernetes `v1.22`. (by @arms11)
7-
* New Feature: Add `existingConfigSecret` . If this is defined, the `st2.secrets.conf` key within this secret will be written as /etc/st2/st2.secrets.conf and added to the end of the command line arguments of all pods. (#289) (by @eric-al)
6+
* Use the correct `apiVersion` for `Ingress` to add support for Kubernetes `v1.22`. (#301) (by @arms11)
7+
* Fix mounts for `jobs.preRegisterContentCommand` container to use the same mounts as the primary register-content container. (#322) (by @cognifloyd)
8+
* Add support for providing custom st2actionrunner-specific docker repository, image name, pull policy, and pull secret via `values.yaml`. (#141) (by @Sheshagiri)
9+
* New Feature: Add `existingConfigSecret`. If this is defined, the `st2.secrets.conf` key within this secret will be written as /etc/st2/st2.secrets.conf and added to the end of the command line arguments of all pods. (#289) (by @eric-al/@ericreeves)
810

911
## v0.100.0
1012
* Switch st2 to `v3.7` as a new default stable version (#274)

templates/deployments.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,9 @@ spec:
13121312
{{- if .Values.st2.packs.images }}
13131313
{{- include "stackstorm-ha.packs-pullSecrets" . | nindent 6 }}
13141314
{{- end }}
1315+
{{- if .Values.st2actionrunner.image.pullSecret }}
1316+
- name: {{ .Values.st2actionrunner.image.pullSecret }}
1317+
{{- end }}
13151318
initContainers:
13161319
{{- include "stackstorm-ha.init-containers-wait-for-db" . | nindent 6 }}
13171320
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
@@ -1320,8 +1323,10 @@ spec:
13201323
{{- end }}
13211324
containers:
13221325
- name: st2actionrunner
1323-
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.st2actionrunner.image.tag | default .Values.image.tag) . }}'
1324-
imagePullPolicy: {{ .Values.image.pullPolicy }}
1326+
{{- with .Values.st2actionrunner }}
1327+
image: '{{ .image.repository | default (include "stackstorm-ha.imageRepository" $) }}/{{ .image.name | default "st2actionrunner" }}:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
1328+
{{- end }}
1329+
imagePullPolicy: {{ .Values.st2actionrunner.image.pullPolicy | default .Values.image.pullPolicy }}
13251330
{{- with default .Values.securityContext .Values.st2actionrunner.securityContext }}
13261331
securityContext: {{- toYaml . | nindent 10 }}
13271332
{{- end }}
@@ -1745,7 +1750,9 @@ spec:
17451750
{{- end }}
17461751
containers:
17471752
- name: st2chatops
1748-
image: '{{ .Values.st2chatops.image.repository | default "stackstorm" }}/{{ .Values.st2chatops.image.name | default "st2chatops" }}:{{ tpl (.Values.st2chatops.image.tag | default .Values.image.tag) . }}'
1753+
{{- with .Values.st2chatops }}
1754+
image: '{{ .image.repository | default (include "stackstorm-ha.imageRepository" $) }}/{{ .image.name | default "st2chatops" }}:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
1755+
{{- end }}
17491756
imagePullPolicy: {{ .Values.st2chatops.image.pullPolicy | default .Values.image.pullPolicy }}
17501757
{{- with .Values.securityContext }}
17511758
securityContext: {{- toYaml . | nindent 10 }}

templates/jobs.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -392,15 +392,10 @@ spec:
392392
{{- end }}
393393
command: {{- toYaml $.Values.jobs.preRegisterContentCommand | nindent 8 }}
394394
volumeMounts:
395+
{{- include "stackstorm-ha.overrides-config-mounts" . | nindent 8 }}
395396
{{- include "stackstorm-ha.st2-config-volume-mounts" . | nindent 8 }}
396-
- name: st2-pack-configs-vol
397-
mountPath: /opt/stackstorm/configs/
398-
{{- if .Values.st2.packs.images }}
399-
- name: st2-packs-vol
400-
mountPath: /opt/stackstorm/packs/
401-
- name: st2-virtualenvs-vol
402-
mountPath: /opt/stackstorm/virtualenvs/
403-
{{- end }}
397+
{{- include "stackstorm-ha.pack-configs-volume-mount" . | nindent 8 }}
398+
{{- include "stackstorm-ha.packs-volume-mounts-for-register-job" . | nindent 8 }}
404399
{{ end }}
405400
containers:
406401
- name: st2-register-content

tests/unit/image_pull_test.yaml

Lines changed: 98 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ templates:
2424
# image.pullPolicy
2525
# serviceAccount.pullPolicy
2626
# st2.packs.images[].pullPolicy
27-
# imagePullSecreets
27+
# st2actionrunner.image.pullPolicy
28+
# imagePullSecrets
2829
# image.pullSecret
2930
# serviceAccount.pullSecret
3031
# st2.packs.images[].pullSecret
32+
# st2actionrunner.image.pullSecret
3133

3234
tests:
3335
- it: Deployments and Jobs use default pullPolicy and pullSecret
@@ -80,9 +82,9 @@ tests:
8082
- deployments.yaml
8183
- jobs.yaml
8284
set:
83-
image:
84-
pullPolicy: Always
85-
pullSecret: custom-pull-secret
85+
image: &globalCustomImage
86+
pullPolicy: &globalCustomImagePullPolicy Always
87+
pullSecret: &globalCustomImagePullSecret custom-pull-secret
8688
serviceAccount:
8789
create: true
8890
# show that this does not affect pod specs
@@ -95,16 +97,104 @@ tests:
9597
jobs:
9698
extra_hooks: *jobs_extra_hooks
9799
asserts:
98-
- equal:
100+
- equal: &eq_custom_pull_secret
99101
path: spec.template.spec.imagePullSecrets[0].name
100-
value: custom-pull-secret
102+
value: *globalCustomImagePullSecret
103+
- equal: &eq_custom_pull_policy
104+
path: spec.template.spec.containers[0].imagePullPolicy
105+
value: *globalCustomImagePullPolicy
106+
# path can only select one element, not all initContainers (if present).
107+
#- equal:
108+
# path: 'spec.template.spec.initContainers[].imagePullPolicy'
109+
# value: *globalCustomImagePullPolicy
110+
111+
# this is only for st2actionrunner for now
112+
- it: Deployments use custom Deployment-specific pullPolicy and pullSecret
113+
templates:
114+
- deployments.yaml
115+
set:
116+
image: *globalCustomImage
117+
st2actionrunner:
118+
image:
119+
pullPolicy: Never
120+
pullSecret: custom-st2actionrunner-pull-secret
121+
st2:
122+
packs: { sensors: [] } # ensure only 1 sensor
123+
st2chatops:
124+
enabled: true
125+
asserts:
126+
- hasDocuments:
127+
count: 14
128+
129+
- equal: *eq_custom_pull_secret
130+
documentIndex: 0
131+
- equal: *eq_custom_pull_secret
132+
documentIndex: 1 # st2api
133+
- equal: *eq_custom_pull_secret
134+
documentIndex: 2
135+
- equal: *eq_custom_pull_secret
136+
documentIndex: 3
137+
- equal: *eq_custom_pull_secret
138+
documentIndex: 4
139+
- equal: *eq_custom_pull_secret
140+
documentIndex: 5
141+
- equal: *eq_custom_pull_secret
142+
documentIndex: 6
143+
- equal: *eq_custom_pull_secret
144+
documentIndex: 7
145+
- equal: *eq_custom_pull_secret
146+
documentIndex: 8
147+
- equal: *eq_custom_pull_secret
148+
documentIndex: 9 # st2sensorcontainer
149+
- equal: *eq_custom_pull_secret
150+
documentIndex: 10 # st2actionrunner
151+
- contains:
152+
path: spec.template.spec.imagePullSecrets
153+
content:
154+
name: custom-st2actionrunner-pull-secret
155+
documentIndex: 10 # st2actionrunner
156+
- equal: *eq_custom_pull_secret
157+
documentIndex: 11
158+
- equal: *eq_custom_pull_secret
159+
documentIndex: 12 # st2client
160+
- equal: *eq_custom_pull_secret
161+
documentIndex: 13
162+
101163
- equal:
102164
path: spec.template.spec.containers[0].imagePullPolicy
103-
value: Always
165+
value: Never
166+
documentIndex: 10 # st2actionrunner
167+
- equal: *eq_custom_pull_policy
168+
documentIndex: 0
169+
- equal: *eq_custom_pull_policy
170+
documentIndex: 1 # st2api
171+
- equal: *eq_custom_pull_policy
172+
documentIndex: 2
173+
- equal: *eq_custom_pull_policy
174+
documentIndex: 3
175+
- equal: *eq_custom_pull_policy
176+
documentIndex: 4
177+
- equal: *eq_custom_pull_policy
178+
documentIndex: 5
179+
- equal: *eq_custom_pull_policy
180+
documentIndex: 6
181+
- equal: *eq_custom_pull_policy
182+
documentIndex: 7
183+
- equal: *eq_custom_pull_policy
184+
documentIndex: 8
185+
- equal: *eq_custom_pull_policy
186+
documentIndex: 9 # st2sensorcontainer
187+
- equal: *eq_custom_pull_policy
188+
documentIndex: 11
189+
- equal: *eq_custom_pull_policy
190+
documentIndex: 12 # st2client
191+
- equal: *eq_custom_pull_policy
192+
documentIndex: 13
193+
104194
# path can only select one element, not all initContainers (if present).
105195
#- equal:
106196
# path: 'spec.template.spec.initContainers[].imagePullPolicy'
107-
# value: Always
197+
# value: *globalCustomImagePullPolicy
108198

109199
- it: ServiceAccount has no imagePullSecret by default
110200
template: service-account.yaml

0 commit comments

Comments
 (0)