Skip to content

Commit 0da5647

Browse files
authored
Merge pull request #162 from plusserver/add_st2_image_pullsecret_support
Added option to define a pull secret for regular st2 images
2 parents 70e861a + f40fc28 commit 0da5647

File tree

4 files changed

+71
-11
lines changed

4 files changed

+71
-11
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Update `rabbitmq-ha` 3rd party chart from `1.44.1` to `1.46.1` (#158) (by @moonrail)
66
* Enable `rabbitmqErlangCookie` for `rabbitmq-ha` by default, to ensure cluster-redeployments do not fail (#158) (by @moonrail)
77
* Add `forceBoot` for `rabbitmq-ha` by default, to ensure cluster-redeployments do not fail due to unclean exits (#158) (by @moonrail)
8+
* Add option to define pull secret for st2 images (#162) (by @moonrail)
89

910
## v0.32.0
1011
* Fix a bug when datastore encrypted keys didn't work in scheduled rules. datastore_crypto_key is now shared with the ``st2scheduler`` pods (#148) (by @rahulshinde26)

templates/deployments.yaml

+52-9
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@ spec:
3434
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
3535
checksum/auth: {{ include (print $.Template.BasePath "/secrets_st2auth.yaml") . | sha256sum }}
3636
spec:
37-
{{- if .Values.enterprise.enabled }}
3837
imagePullSecrets:
38+
{{- if .Values.enterprise.enabled }}
3939
- name: {{ .Release.Name }}-st2-license
4040
{{- end }}
41+
{{- if .Values.image.pullSecret }}
42+
- name: {{ .Values.image.pullSecret }}
43+
{{- end }}
4144
# Sidecar container for generating .htpasswd with st2 username & password pair and sharing produced file with the main st2auth container
4245
initContainers:
4346
- name: generate-htpasswd
@@ -152,6 +155,9 @@ spec:
152155
{{- if .Values.st2.packs.image.pullSecret }}
153156
- name: {{ .Values.st2.packs.image.pullSecret }}
154157
{{- end }}
158+
{{- if .Values.image.pullSecret }}
159+
- name: {{ .Values.image.pullSecret }}
160+
{{- end }}
155161
{{- if .Values.st2.packs.image.repository }}
156162
initContainers:
157163
# Merge packs and virtualenvs from st2api with those from the st2.packs image
@@ -289,10 +295,13 @@ spec:
289295
annotations:
290296
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
291297
spec:
292-
{{- if .Values.enterprise.enabled }}
293298
imagePullSecrets:
299+
{{- if .Values.enterprise.enabled }}
294300
- name: {{ .Release.Name }}-st2-license
295301
{{- end }}
302+
{{- if .Values.image.pullSecret }}
303+
- name: {{ .Values.image.pullSecret }}
304+
{{- end }}
296305
containers:
297306
- name: st2stream{{ template "enterpriseSuffix" . }}
298307
image: "{{ template "imageRepository" . }}/st2stream{{ template "enterpriseSuffix" . }}:{{ .Chart.AppVersion }}"
@@ -365,10 +374,13 @@ spec:
365374
release: {{ .Release.Name }}
366375
heritage: {{ .Release.Service }}
367376
spec:
368-
{{- if .Values.enterprise.enabled }}
369377
imagePullSecrets:
378+
{{- if .Values.enterprise.enabled }}
370379
- name: {{ .Release.Name }}-st2-license
371380
{{- end }}
381+
{{- if .Values.image.pullSecret }}
382+
- name: {{ .Values.image.pullSecret }}
383+
{{- end }}
372384
containers:
373385
- name: st2web{{ template "enterpriseSuffix" . }}
374386
image: "{{ template "imageRepository" . }}/st2web{{ template "enterpriseSuffix" . }}:{{ .Chart.AppVersion }}"
@@ -452,10 +464,13 @@ spec:
452464
annotations:
453465
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
454466
spec:
455-
{{- if .Values.enterprise.enabled }}
456467
imagePullSecrets:
468+
{{- if .Values.enterprise.enabled }}
457469
- name: {{ .Release.Name }}-st2-license
458470
{{- end }}
471+
{{- if .Values.image.pullSecret }}
472+
- name: {{ .Values.image.pullSecret }}
473+
{{- end }}
459474
containers:
460475
- name: st2rulesengine{{ template "enterpriseSuffix" . }}
461476
image: "{{ template "imageRepository" . }}/st2rulesengine{{ template "enterpriseSuffix" . }}:{{ .Chart.AppVersion }}"
@@ -539,10 +554,13 @@ spec:
539554
annotations:
540555
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
541556
spec:
542-
{{- if .Values.enterprise.enabled }}
543557
imagePullSecrets:
558+
{{- if .Values.enterprise.enabled }}
544559
- name: {{ .Release.Name }}-st2-license
545560
{{- end }}
561+
{{- if .Values.image.pullSecret }}
562+
- name: {{ .Values.image.pullSecret }}
563+
{{- end }}
546564
containers:
547565
- name: st2timersengine{{ template "enterpriseSuffix" . }}
548566
image: "{{ template "imageRepository" . }}/st2timersengine{{ template "enterpriseSuffix" . }}:{{ .Chart.AppVersion }}"
@@ -618,10 +636,13 @@ spec:
618636
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
619637
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
620638
spec:
621-
{{- if .Values.enterprise.enabled }}
622639
imagePullSecrets:
640+
{{- if .Values.enterprise.enabled }}
623641
- name: {{ .Release.Name }}-st2-license
624642
{{- end }}
643+
{{- if .Values.image.pullSecret }}
644+
- name: {{ .Values.image.pullSecret }}
645+
{{- end }}
625646
containers:
626647
- name: st2workflowengine{{ template "enterpriseSuffix" . }}
627648
image: "{{ template "imageRepository" . }}/st2workflowengine{{ template "enterpriseSuffix" . }}:{{ .Chart.AppVersion }}"
@@ -709,10 +730,13 @@ spec:
709730
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
710731
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
711732
spec:
712-
{{- if .Values.enterprise.enabled }}
713733
imagePullSecrets:
734+
{{- if .Values.enterprise.enabled }}
714735
- name: {{ .Release.Name }}-st2-license
715736
{{- end }}
737+
{{- if .Values.image.pullSecret }}
738+
- name: {{ .Values.image.pullSecret }}
739+
{{- end }}
716740
containers:
717741
- name: st2scheduler{{ template "enterpriseSuffix" . }}
718742
image: "{{ template "imageRepository" . }}/st2scheduler{{ template "enterpriseSuffix" . }}:{{ .Chart.AppVersion }}"
@@ -800,10 +824,13 @@ spec:
800824
annotations:
801825
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
802826
spec:
803-
{{- if .Values.enterprise.enabled }}
804827
imagePullSecrets:
828+
{{- if .Values.enterprise.enabled }}
805829
- name: {{ .Release.Name }}-st2-license
806830
{{- end }}
831+
{{- if .Values.image.pullSecret }}
832+
- name: {{ .Values.image.pullSecret }}
833+
{{- end }}
807834
containers:
808835
- name: st2notifier{{ template "enterpriseSuffix" . }}
809836
image: "{{ template "imageRepository" . }}/st2notifier{{ template "enterpriseSuffix" . }}:{{ .Chart.AppVersion }}"
@@ -893,6 +920,9 @@ spec:
893920
{{- if $.Values.st2.packs.image.pullSecret }}
894921
- name: {{ $.Values.st2.packs.image.pullSecret }}
895922
{{- end }}
923+
{{- if $.Values.image.pullSecret }}
924+
- name: {{ $.Values.image.pullSecret }}
925+
{{- end }}
896926
{{- if $.Values.st2.packs.image.repository }}
897927
initContainers:
898928
# Merge packs and virtualenvs from st2sensorcontainer with those from the st2.packs image
@@ -1059,6 +1089,9 @@ spec:
10591089
{{- if .Values.st2.packs.image.pullSecret }}
10601090
- name: {{ .Values.st2.packs.image.pullSecret }}
10611091
{{- end }}
1092+
{{- if .Values.image.pullSecret }}
1093+
- name: {{ .Values.image.pullSecret }}
1094+
{{- end }}
10621095
{{- if .Values.st2.packs.image.repository }}
10631096
initContainers:
10641097
# Merge packs and virtualenvs from st2actionrunner with those from the st2.packs image
@@ -1203,10 +1236,13 @@ spec:
12031236
annotations:
12041237
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
12051238
spec:
1206-
{{- if .Values.enterprise.enabled }}
12071239
imagePullSecrets:
1240+
{{- if .Values.enterprise.enabled }}
12081241
- name: {{ .Release.Name }}-st2-license
12091242
{{- end }}
1243+
{{- if .Values.image.pullSecret }}
1244+
- name: {{ .Values.image.pullSecret }}
1245+
{{- end }}
12101246
containers:
12111247
- name: st2garbagecollector{{ template "enterpriseSuffix" . }}
12121248
image: "{{ template "imageRepository" . }}/st2garbagecollector{{ template "enterpriseSuffix" . }}:{{ .Chart.AppVersion }}"
@@ -1293,6 +1329,9 @@ spec:
12931329
{{- if .Values.st2.packs.image.pullSecret }}
12941330
- name: {{ .Values.st2.packs.image.pullSecret }}
12951331
{{- end }}
1332+
{{- if .Values.image.pullSecret }}
1333+
- name: {{ .Values.image.pullSecret }}
1334+
{{- end }}
12961335
initContainers:
12971336
{{- if .Values.st2.packs.image.repository }}
12981337
# Merge packs and virtualenvs from st2actionrunner with those from the st2.packs image
@@ -1488,6 +1527,10 @@ spec:
14881527
annotations:
14891528
checksum/chatops: {{ include (print $.Template.BasePath "/secrets_st2chatops.yaml") . | sha256sum }}
14901529
spec:
1530+
{{- if .Values.image.pullSecret }}
1531+
imagePullSecrets:
1532+
- name: {{ .Values.image.pullSecret }}
1533+
{{- end }}
14911534
containers:
14921535
- name: st2chatops{{ template "enterpriseSuffix" . }}
14931536
image: "{{ .Values.st2chatops.image.repository | default "stackstorm" }}/{{ .Values.st2chatops.image.name | default "st2chatops" }}:{{ tpl (.Values.st2chatops.image.tag | default .Chart.AppVersion) . }}"

templates/jobs.yaml

+14-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ spec:
3535
spec:
3636
imagePullSecrets:
3737
- name: {{ .Release.Name }}-st2-license
38+
{{- if .Values.image.pullSecret }}
39+
- name: {{ .Values.image.pullSecret }}
40+
{{- end }}
3841
containers:
3942
- name: st2-apply-rbac-definitions
4043
image: "{{ template "imageRepository" . }}/st2actionrunner{{ template "enterpriseSuffix" . }}:{{ .Chart.AppVersion }}"
@@ -110,10 +113,13 @@ spec:
110113
checksum/urls: {{ include (print $.Template.BasePath "/configmaps_st2-urls.yaml") . | sha256sum }}
111114
checksum/apikeys: {{ include (print $.Template.BasePath "/secrets_st2apikeys.yaml") . | sha256sum }}
112115
spec:
113-
{{- if .Values.enterprise.enabled }}
114116
imagePullSecrets:
117+
{{- if .Values.enterprise.enabled }}
115118
- name: {{ .Release.Name }}-st2-license
116119
{{- end }}
120+
{{- if .Values.image.pullSecret }}
121+
- name: {{ .Values.image.pullSecret }}
122+
{{- end }}
117123
initContainers:
118124
# Sidecar container for generating st2client config with st2 username & password pair and sharing produced file with the main container
119125
- name: generate-st2client-config
@@ -209,10 +215,13 @@ spec:
209215
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
210216
checksum/urls: {{ include (print $.Template.BasePath "/configmaps_st2-urls.yaml") . | sha256sum }}
211217
spec:
212-
{{- if .Values.enterprise.enabled }}
213218
imagePullSecrets:
219+
{{- if .Values.enterprise.enabled }}
214220
- name: {{ .Release.Name }}-st2-license
215221
{{- end }}
222+
{{- if .Values.image.pullSecret }}
223+
- name: {{ .Values.image.pullSecret }}
224+
{{- end }}
216225
initContainers:
217226
# Sidecar container for generating st2client config with st2 username & password pair and sharing produced file with the main container
218227
- name: generate-st2client-config
@@ -324,6 +333,9 @@ spec:
324333
{{- if .Values.st2.packs.image.pullSecret }}
325334
- name: {{ .Values.st2.packs.image.pullSecret }}
326335
{{- end }}
336+
{{- if .Values.image.pullSecret }}
337+
- name: {{ .Values.image.pullSecret }}
338+
{{- end }}
327339
{{- if .Values.st2.packs.image.repository }}
328340
initContainers:
329341
# Merge packs and virtualenvs from st2actionrunner with those from the st2.packs image

values.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ image:
1212
# st2chatops and st2packs (which have their own override). This also does not impact
1313
# dependencies such as mongo or redis, which have their own helm chart settings.
1414
repository: ""
15+
# Image pull secret.
16+
# May be required for public docker hub due to rate limiting or any private repository.
17+
# See: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
18+
#pullSecret: "your-pull-secret"
1519

1620

1721
##

0 commit comments

Comments
 (0)