Skip to content

Commit 5791b33

Browse files
guzzijonesajjonen
authored andcommitted
utilityImage
1 parent 1332ae8 commit 5791b33

File tree

4 files changed

+35
-35
lines changed

4 files changed

+35
-35
lines changed

templates/_helpers.tpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ app.kubernetes.io/instance: {{ $root.Release.Name }}
4040
{{- end -}}
4141

4242
{{/*
43-
Generate Docker image registry: container registry
43+
Generate Docker utility image line
4444
*/}}
45-
{{- define "stackstorm-ha.imageRegistry" -}}
46-
{{- if .Values.image.registry -}}
47-
{{ .Values.image.registry }}
45+
{{- define "stackstorm-ha.utilityImage" -}}
46+
{{- if .Values.image.utilityImage -}}
47+
{{ .Values.image.utilityImage }}
4848
{{- else -}}
49-
'docker.io'
49+
'docker.io/library/busybox:1.28'
5050
{{- end -}}
5151
{{- end -}}
5252

@@ -177,7 +177,7 @@ Reduce duplication of the st2.*.conf volume details
177177
{{- if index .Values "mongodb" "enabled" }}
178178
{{- $mongodb_port := (int (index .Values "mongodb" "service" "port")) }}
179179
- name: wait-for-db
180-
image: {{ template "stackstorm-ha.imageRegistry" . }}/library/busybox:1.28
180+
image: {{ template "stackstorm-ha.utilityImage" . }}
181181
command:
182182
- 'sh'
183183
- '-c'
@@ -197,7 +197,7 @@ Reduce duplication of the st2.*.conf volume details
197197
{{- if index .Values "rabbitmq" "enabled" }}
198198
{{- $rabbitmq_port := (int (index .Values "rabbitmq" "service" "port")) }}
199199
- name: wait-for-queue
200-
image: {{ template "stackstorm-ha.imageRegistry" . }}/library/busybox:1.28
200+
image: {{ template "stackstorm-ha.utilityImage" . }}
201201
command:
202202
- 'sh'
203203
- '-c'

templates/deployments.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ spec:
4545
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
4646
# Sidecar container for generating .htpasswd with st2 username & password pair and sharing produced file with the main st2auth container
4747
- name: generate-htpasswd
48-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2auth:{{ tpl (.Values.st2auth.image.tag | default .Values.image.tag) . }}'
48+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2auth:{{ tpl (.Values.st2auth.image.tag | default .Values.image.tag) . }}'
4949
imagePullPolicy: {{ .Values.image.pullPolicy }}
5050
{{- with .Values.securityContext }}
5151
securityContext: {{- toYaml . | nindent 10 }}
@@ -62,7 +62,7 @@ spec:
6262
- printf "${ST2_AUTH_USERNAME}:$(openssl passwd -apr1 "${ST2_AUTH_PASSWORD}")\n" > /tmp/st2/htpasswd
6363
containers:
6464
- name: st2auth
65-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2auth:{{ tpl (.Values.st2auth.image.tag | default .Values.image.tag) . }}'
65+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2auth:{{ tpl (.Values.st2auth.image.tag | default .Values.image.tag) . }}'
6666
imagePullPolicy: {{ .Values.image.pullPolicy }}
6767
{{- with .Values.securityContext }}
6868
securityContext: {{- toYaml . | nindent 10 }}
@@ -181,7 +181,7 @@ spec:
181181
{{- end }}
182182
containers:
183183
- name: st2api
184-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2api:{{ tpl (.Values.st2api.image.tag | default .Values.image.tag) . }}'
184+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2api:{{ tpl (.Values.st2api.image.tag | default .Values.image.tag) . }}'
185185
imagePullPolicy: {{ .Values.image.pullPolicy }}
186186
{{- with .Values.securityContext }}
187187
securityContext: {{- toYaml . | nindent 10 }}
@@ -307,7 +307,7 @@ spec:
307307
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
308308
containers:
309309
- name: st2stream
310-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2stream:{{ tpl (.Values.st2stream.image.tag | default .Values.image.tag) . }}'
310+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2stream:{{ tpl (.Values.st2stream.image.tag | default .Values.image.tag) . }}'
311311
imagePullPolicy: {{ .Values.image.pullPolicy }}
312312
{{- with .Values.securityContext }}
313313
securityContext: {{- toYaml . | nindent 10 }}
@@ -407,7 +407,7 @@ spec:
407407
{{- end }}
408408
containers:
409409
- name: st2web
410-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2web:{{ tpl (.Values.st2web.image.tag | default .Values.image.tag) . }}'
410+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2web:{{ tpl (.Values.st2web.image.tag | default .Values.image.tag) . }}'
411411
imagePullPolicy: {{ .Values.image.pullPolicy }}
412412
{{- with default .Values.securityContext .Values.st2web.securityContext }}
413413
securityContext: {{- toYaml . | nindent 10 }}
@@ -541,7 +541,7 @@ spec:
541541
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
542542
containers:
543543
- name: st2rulesengine
544-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2rulesengine:{{ tpl (.Values.st2rulesengine.image.tag | default .Values.image.tag) . }}'
544+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2rulesengine:{{ tpl (.Values.st2rulesengine.image.tag | default .Values.image.tag) . }}'
545545
imagePullPolicy: {{ .Values.image.pullPolicy }}
546546
{{- with .Values.securityContext }}
547547
securityContext: {{- toYaml . | nindent 10 }}
@@ -658,7 +658,7 @@ spec:
658658
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
659659
containers:
660660
- name: st2timersengine
661-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2timersengine:{{ tpl (.Values.st2timersengine.image.tag | default .Values.image.tag) . }}'
661+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2timersengine:{{ tpl (.Values.st2timersengine.image.tag | default .Values.image.tag) . }}'
662662
imagePullPolicy: {{ .Values.image.pullPolicy }}
663663
{{- with .Values.securityContext }}
664664
securityContext: {{- toYaml . | nindent 10 }}
@@ -762,7 +762,7 @@ spec:
762762
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
763763
containers:
764764
- name: st2workflowengine
765-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2workflowengine:{{ tpl (.Values.st2workflowengine.image.tag | default .Values.image.tag) . }}'
765+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2workflowengine:{{ tpl (.Values.st2workflowengine.image.tag | default .Values.image.tag) . }}'
766766
imagePullPolicy: {{ .Values.image.pullPolicy }}
767767
{{- with .Values.securityContext }}
768768
securityContext: {{- toYaml . | nindent 10 }}
@@ -878,7 +878,7 @@ spec:
878878
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
879879
containers:
880880
- name: st2scheduler
881-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2scheduler:{{ tpl (.Values.st2scheduler.image.tag | default .Values.image.tag) . }}'
881+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2scheduler:{{ tpl (.Values.st2scheduler.image.tag | default .Values.image.tag) . }}'
882882
imagePullPolicy: {{ .Values.image.pullPolicy }}
883883
{{- with .Values.securityContext }}
884884
securityContext: {{- toYaml . | nindent 10 }}
@@ -994,7 +994,7 @@ spec:
994994
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
995995
containers:
996996
- name: st2notifier
997-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2notifier:{{ tpl (.Values.st2notifier.image.tag | default .Values.image.tag) . }}'
997+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2notifier:{{ tpl (.Values.st2notifier.image.tag | default .Values.image.tag) . }}'
998998
imagePullPolicy: {{ .Values.image.pullPolicy }}
999999
{{- with .Values.securityContext }}
10001000
securityContext: {{- toYaml . | nindent 10 }}
@@ -1138,7 +1138,7 @@ spec:
11381138
initContainers:
11391139
{{- if $some_sensors_per_pod }}
11401140
- name: {{ $name }}-init-config
1141-
image: '{{ template "stackstorm-ha.imageRegistry" $ }}/library/busybox:1.28'
1141+
image: '{{ template "stackstorm-ha.utilityImage" $ }}'
11421142
volumeMounts:
11431143
- name: st2-sensor-config-vol
11441144
mountPath: /tmp/st2
@@ -1160,7 +1160,7 @@ spec:
11601160
{{- end }}
11611161
containers:
11621162
- name: {{ $name }}
1163-
image: '{{ template "stackstorm-ha.imageRegistry" $ }}/{{ template "stackstorm-ha.imageRepository" $ }}/st2sensorcontainer:{{ tpl ($sensor.image.tag | default $.Values.image.tag) $ }}'
1163+
image: '{{ template "stackstorm-ha.imageRepository" $ }}/st2sensorcontainer:{{ tpl ($sensor.image.tag | default $.Values.image.tag) $ }}'
11641164
imagePullPolicy: {{ $.Values.image.pullPolicy }}
11651165
{{- with default $.Values.securityContext $sensor.securityContext }}
11661166
securityContext: {{- toYaml . | nindent 10 }}
@@ -1324,7 +1324,7 @@ spec:
13241324
containers:
13251325
- name: st2actionrunner
13261326
{{- with .Values.st2actionrunner }}
1327-
image: '{{ .image.registry | default (include "stackstorm-ha.imageRegistry" $) }}/{{ .image.repository | default (include "stackstorm-ha.imageRepository" $) }}/{{ .image.name | default "st2actionrunner" }}:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
1327+
image: '{{ .image.repository | default (include "stackstorm-ha.imageRepository" $) }}/{{ .image.name | default "st2actionrunner" }}:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
13281328
{{- end }}
13291329
imagePullPolicy: {{ .Values.st2actionrunner.image.pullPolicy | default .Values.image.pullPolicy }}
13301330
{{- with default .Values.securityContext .Values.st2actionrunner.securityContext }}
@@ -1459,7 +1459,7 @@ spec:
14591459
{{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
14601460
containers:
14611461
- name: st2garbagecollector
1462-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2garbagecollector:{{ tpl (.Values.st2garbagecollector.image.tag | default .Values.image.tag) . }}'
1462+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2garbagecollector:{{ tpl (.Values.st2garbagecollector.image.tag | default .Values.image.tag) . }}'
14631463
imagePullPolicy: {{ .Values.image.pullPolicy }}
14641464
{{- with .Values.securityContext }}
14651465
securityContext: {{- toYaml . | nindent 10 }}
@@ -1572,7 +1572,7 @@ spec:
15721572
{{- end }}
15731573
# Sidecar container for generating st2client config with st2 username & password pair and sharing produced file with the main container
15741574
- name: generate-st2client-config
1575-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.st2client.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
1575+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.st2client.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
15761576
imagePullPolicy: {{ .Values.image.pullPolicy }}
15771577
{{- with .Values.securityContext }}
15781578
securityContext: {{- toYaml . | nindent 10 }}
@@ -1599,7 +1599,7 @@ spec:
15991599
EOT
16001600
containers:
16011601
- name: st2client
1602-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.st2client.image.tag | default .Values.image.tag) . }}'
1602+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.st2client.image.tag | default .Values.image.tag) . }}'
16031603
imagePullPolicy: {{ .Values.image.pullPolicy }}
16041604
{{- with default .Values.securityContext .Values.st2actionrunner.securityContext }}
16051605
securityContext: {{- toYaml . | nindent 10 }}
@@ -1749,7 +1749,7 @@ spec:
17491749
containers:
17501750
- name: st2chatops
17511751
{{- with .Values.st2chatops }}
1752-
image: '{{ .image.registry | default (include "stackstorm-ha.imageRegistry" $) }}/{{ .image.repository | default (include "stackstorm-ha.imageRepository" $) }}/{{ .image.name | default "st2chatops" }}:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
1752+
image: '{{ .image.repository | default (include "stackstorm-ha.imageRepository" $) }}/{{ .image.name | default "st2chatops" }}:{{ tpl (.image.tag | default $.Values.image.tag) $ }}'
17531753
{{- end }}
17541754
imagePullPolicy: {{ .Values.st2chatops.image.pullPolicy | default .Values.image.pullPolicy }}
17551755
{{- with .Values.securityContext }}

templates/jobs.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
{{- end }}
3232
containers:
3333
- name: st2-apply-rbac-definitions
34-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
34+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
3535
imagePullPolicy: {{ .Values.image.pullPolicy }}
3636
{{- with .Values.securityContext }}
3737
securityContext: {{- toYaml . | nindent 10 }}
@@ -134,7 +134,7 @@ spec:
134134
initContainers:
135135
{{- include "stackstorm-ha.init-containers-wait-for-db" . | nindent 6 }}
136136
- name: wait-for-api
137-
image: {{ template "stackstorm-ha.imageRegistry" . }}/library/busybox:1.28
137+
image: {{ template "stackstorm-ha.utilityImage" . }}
138138
{{- with .Values.securityContext }}
139139
securityContext: {{- toYaml . | nindent 10 }}
140140
{{- end }}
@@ -147,7 +147,7 @@ spec:
147147
done
148148
# Sidecar container for generating st2client config with st2 username & password pair and sharing produced file with the main container
149149
- name: generate-st2client-config
150-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
150+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
151151
imagePullPolicy: {{ .Values.image.pullPolicy }}
152152
{{- with .Values.securityContext }}
153153
securityContext: {{- toYaml . | nindent 10 }}
@@ -174,7 +174,7 @@ spec:
174174
EOT
175175
containers:
176176
- name: st2-apikey-load
177-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
177+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
178178
imagePullPolicy: {{ .Values.image.pullPolicy }}
179179
{{- with .Values.securityContext }}
180180
securityContext: {{- toYaml . | nindent 10 }}
@@ -273,7 +273,7 @@ spec:
273273
{{- include "stackstorm-ha.init-containers-wait-for-db" . | nindent 6 }}
274274
# Sidecar container for generating st2client config with st2 username & password pair and sharing produced file with the main container
275275
- name: generate-st2client-config
276-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
276+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
277277
imagePullPolicy: {{ .Values.image.pullPolicy }}
278278
{{- with .Values.securityContext }}
279279
securityContext: {{- toYaml . | nindent 10 }}
@@ -300,7 +300,7 @@ spec:
300300
EOT
301301
containers:
302302
- name: st2-key-load
303-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
303+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
304304
imagePullPolicy: {{ .Values.image.pullPolicy }}
305305
{{- with .Values.securityContext }}
306306
securityContext: {{- toYaml . | nindent 10 }}
@@ -409,7 +409,7 @@ spec:
409409
{{- include "stackstorm-ha.packs-initContainers" . | nindent 6 }}
410410
{{- if $.Values.jobs.preRegisterContentCommand }}
411411
- name: st2-register-content-custom-init
412-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
412+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
413413
imagePullPolicy: {{ .Values.image.pullPolicy }}
414414
{{- with .Values.securityContext }}
415415
securityContext: {{- toYaml . | nindent 10 }}
@@ -423,7 +423,7 @@ spec:
423423
{{ end }}
424424
containers:
425425
- name: st2-register-content
426-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
426+
image: '{{ template "stackstorm-ha.imageRepository" . }}/st2actionrunner:{{ tpl (.Values.jobs.image.tag | default (.Values.st2actionrunner.image.tag | default .Values.image.tag)) . }}'
427427
imagePullPolicy: {{ .Values.image.pullPolicy }}
428428
{{- with .Values.securityContext }}
429429
securityContext: {{- toYaml . | nindent 10 }}
@@ -526,7 +526,7 @@ spec:
526526
{{- include "stackstorm-ha.init-containers-wait-for-db" $ | nindent 6 }}
527527
{{- include "stackstorm-ha.packs-initContainers" $ | nindent 6 }}
528528
- name: generate-st2client-config
529-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" $ }}/st2actionrunner:{{ tpl ($.Values.jobs.image.tag | default ($.Values.st2actionrunner.image.tag | default $.Values.image.tag)) $ }}'
529+
image: '{{ template "stackstorm-ha.imageRepository" $ }}/st2actionrunner:{{ tpl ($.Values.jobs.image.tag | default ($.Values.st2actionrunner.image.tag | default $.Values.image.tag)) $ }}'
530530
imagePullPolicy: {{ $.Values.image.pullPolicy }}
531531
{{- with $.Values.securityContext }}
532532
securityContext: {{- toYaml . | nindent 10 }}
@@ -554,7 +554,7 @@ spec:
554554
EOT
555555
containers:
556556
- name: {{ $name }}
557-
image: '{{ template "stackstorm-ha.imageRegistry" . }}/{{ template "stackstorm-ha.imageRepository" $ }}/st2actionrunner:{{ tpl ($.Values.jobs.image.tag | default ($.Values.st2actionrunner.image.tag | default $.Values.image.tag)) $ }}'
557+
image: '{{ template "stackstorm-ha.imageRepository" $ }}/st2actionrunner:{{ tpl ($.Values.jobs.image.tag | default ($.Values.st2actionrunner.image.tag | default $.Values.image.tag)) $ }}'
558558
imagePullPolicy: {{ $.Values.image.pullPolicy }}
559559
{{- with $.Values.securityContext }}
560560
securityContext: {{- toYaml . | nindent 10 }}

values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
##
77
image:
88

9-
registry: ""
9+
utilityImage: ""
1010
# Image pull policy
1111
pullPolicy: IfNotPresent
1212
# st2 image repository. Set this to override the default ("stackstorm").

0 commit comments

Comments
 (0)