1+ # Notify users about breaking change regarding packs, to not destroy current installations
2+ {{- if and .Values.st2.packs.image }}
3+ {{- fail "Value st2.packs.image was renamed to st2.packs.images and is now a list of images" }}
4+ {{- end }}
5+
16---
27apiVersion : apps/v1
38kind : Deployment
@@ -142,47 +147,17 @@ spec:
142147 checksum/datastore-key : {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
143148 spec :
144149 imagePullSecrets :
145- {{- if .Values.st2.packs.image.pullSecret }}
146- - name : {{ .Values.st2.packs.image.pullSecret }}
147- {{- end }}
148150 {{- if .Values.image.pullSecret }}
149151 - name : {{ .Values.image.pullSecret }}
152+ {{- end }}
153+ {{- if .Values.st2.packs.images }}
154+ {{- include "packs-pullSecrets" . | indent 6 }}
150155 {{- end }}
151156 initContainers :
152157 {{ include "init-containers-wait-for-db" . | indent 6 }}
153158 {{ include "init-containers-wait-for-mq" . | indent 6 }}
154- {{- if .Values.st2.packs.image.repository }}
155- # Merge packs and virtualenvs from st2api with those from the st2.packs image
156- # Custom packs
157- - name : st2-custom-packs
158- image : " {{ .Values.st2.packs.image.repository }}/{{ .Values.st2.packs.image.name }}:{{ .Values.st2.packs.image.tag }}"
159- imagePullPolicy : {{ .Values.st2.packs.image.pullPolicy | quote }}
160- volumeMounts :
161- - name : st2-packs-vol
162- mountPath : /opt/stackstorm/packs-shared
163- - name : st2-virtualenvs-vol
164- mountPath : /opt/stackstorm/virtualenvs-shared
165- command :
166- - ' sh'
167- - ' -ec'
168- - |
169- /bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
170- /bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
171- # System packs
172- - name : st2-system-packs
173- image : " {{ template " imageRepository" . }}/st2actionrunner:{{ .Chart.AppVersion }}"
174- imagePullPolicy : {{ .Values.image.pullPolicy }}
175- volumeMounts :
176- - name : st2-packs-vol
177- mountPath : /opt/stackstorm/packs-shared
178- - name : st2-virtualenvs-vol
179- mountPath : /opt/stackstorm/virtualenvs-shared
180- command :
181- - ' sh'
182- - ' -ec'
183- - |
184- /bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
185- /bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
159+ {{- if .Values.st2.packs.images }}
160+ {{- include "packs-initContainers" . | indent 6 }}
186161 {{- end }}
187162 containers :
188163 - name : st2api
@@ -208,7 +183,7 @@ spec:
208183 mountPath : /etc/st2/keys
209184 readOnly : true
210185 {{- end }}
211- {{- if .Values.st2.packs.image.repository }}
186+ {{- if .Values.st2.packs.images }}
212187 - name : st2-packs-vol
213188 mountPath : /opt/stackstorm/packs
214189 readOnly : true
@@ -233,11 +208,8 @@ spec:
233208 - name : st2-config-vol
234209 configMap :
235210 name : {{ .Release.Name }}-st2-config
236- {{- if .Values.st2.packs.image.repository }}
237- - name : st2-packs-vol
238- emptyDir : {}
239- - name : st2-virtualenvs-vol
240- emptyDir : {}
211+ {{- if .Values.st2.packs.images }}
212+ {{- include "packs-volumes" . | indent 8 }}
241213 {{- end }}
242214 {{- with .Values.st2api.nodeSelector }}
243215 nodeSelector :
@@ -895,45 +867,17 @@ spec:
895867 {{- end }}
896868 spec :
897869 imagePullSecrets :
898- {{- if $.Values.st2.packs.image.pullSecret }}
899- - name : {{ $.Values.st2.packs.image.pullSecret }}
900- {{- end }}
901870 {{- if $.Values.image.pullSecret }}
902871 - name : {{ $.Values.image.pullSecret }}
872+ {{- end }}
873+ {{- if $.Values.st2.packs.images }}
874+ {{- include "packs-pullSecrets" $ | indent 6 }}
903875 {{- end }}
904876 initContainers :
905877 {{ include "init-containers-wait-for-db" $ | indent 6 }}
906878 {{ include "init-containers-wait-for-mq" $ | indent 6 }}
907- {{- if $.Values.st2.packs.image.repository }}
908- # Merge packs and virtualenvs from st2sensorcontainer with those from the st2.packs image
909- # Custom packs
910- - name : st2-custom-packs
911- image : " {{ $.Values.st2.packs.image.repository }}/{{ $.Values.st2.packs.image.name }}:{{ $.Values.st2.packs.image.tag }}"
912- imagePullPolicy : {{ $.Values.st2.packs.image.pullPolicy | quote }}
913- volumeMounts :
914- - name : st2-packs-vol
915- mountPath : /opt/stackstorm/packs-shared
916- - name : st2-virtualenvs-vol
917- mountPath : /opt/stackstorm/virtualenvs-shared
918- command :
919- - ' sh'
920- - ' -ec'
921- - |
922- /bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
923- /bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
924- # System packs
925- - name : st2-system-packs
926- image : " {{ template " imageRepository" $ }}/st2actionrunner:{{ $.Chart.AppVersion }}"
927- imagePullPolicy : {{ $.Values.image.pullPolicy }}
928- volumeMounts :
929- - name : st2-packs-vol
930- mountPath : /opt/stackstorm/packs-shared
931- command :
932- - ' sh'
933- - ' -ec'
934- - |
935- /bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
936- /bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
879+ {{- if $.Values.st2.packs.images }}
880+ {{- include "packs-initContainers" $ | indent 6 }}
937881 {{- end }}
938882 containers :
939883 - name : st2sensorcontainer{{ template "hyphenPrefix" .name }}
@@ -967,7 +911,7 @@ spec:
967911 - name : st2-config-vol
968912 mountPath : /etc/st2/st2.user.conf
969913 subPath : st2.user.conf
970- {{- if $.Values.st2.packs.image.repository }}
914+ {{- if $.Values.st2.packs.images }}
971915 - name : st2-packs-vol
972916 mountPath : /opt/stackstorm/packs
973917 readOnly : true
@@ -997,11 +941,8 @@ spec:
997941 - name : st2-config-vol
998942 configMap :
999943 name : {{ $.Release.Name }}-st2-config
1000- {{- if $.Values.st2.packs.image.repository }}
1001- - name : st2-packs-vol
1002- emptyDir : {}
1003- - name : st2-virtualenvs-vol
1004- emptyDir : {}
944+ {{- if $.Values.st2.packs.images }}
945+ {{- include "packs-volumes" $ | indent 8 }}
1005946 {{- end }}
1006947 {{- with .nodeSelector }}
1007948 nodeSelector :
@@ -1060,45 +1001,17 @@ spec:
10601001{{ toYaml .Values.st2actionrunner.hostAliases | indent 8 }}
10611002 {{- end }}
10621003 imagePullSecrets :
1063- {{- if .Values.st2.packs.image.pullSecret }}
1064- - name : {{ .Values.st2.packs.image.pullSecret }}
1065- {{- end }}
10661004 {{- if .Values.image.pullSecret }}
10671005 - name : {{ .Values.image.pullSecret }}
1006+ {{- end }}
1007+ {{- if .Values.st2.packs.images }}
1008+ {{- include "packs-pullSecrets" . | indent 6 }}
10681009 {{- end }}
10691010 initContainers :
10701011 {{ include "init-containers-wait-for-db" . | indent 6 }}
10711012 {{ include "init-containers-wait-for-mq" . | indent 6 }}
1072- {{- if .Values.st2.packs.image.repository }}
1073- # Merge packs and virtualenvs from st2actionrunner with those from the st2.packs image
1074- # Custom packs
1075- - name : st2-custom-packs
1076- image : " {{ .Values.st2.packs.image.repository }}/{{ .Values.st2.packs.image.name }}:{{ .Values.st2.packs.image.tag }}"
1077- imagePullPolicy : {{ .Values.st2.packs.image.pullPolicy | quote }}
1078- volumeMounts :
1079- - name : st2-packs-vol
1080- mountPath : /opt/stackstorm/packs-shared
1081- - name : st2-virtualenvs-vol
1082- mountPath : /opt/stackstorm/virtualenvs-shared
1083- command :
1084- - ' sh'
1085- - ' -ec'
1086- - |
1087- /bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
1088- /bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
1089- # System packs
1090- - name : st2-system-packs
1091- image : " {{ template " imageRepository" . }}/st2actionrunner:{{ .Chart.AppVersion }}"
1092- imagePullPolicy : {{ .Values.image.pullPolicy }}
1093- volumeMounts :
1094- - name : st2-packs-vol
1095- mountPath : /opt/stackstorm/packs-shared
1096- command :
1097- - ' sh'
1098- - ' -ec'
1099- - |
1100- /bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
1101- /bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
1013+ {{- if .Values.st2.packs.images }}
1014+ {{- include "packs-initContainers" . | indent 6 }}
11021015 {{- end }}
11031016 containers :
11041017 - name : st2actionrunner
@@ -1125,7 +1038,7 @@ spec:
11251038 mountPath : /etc/st2/keys
11261039 readOnly : true
11271040 {{- end }}
1128- {{- if .Values.st2.packs.image.repository }}
1041+ {{- if .Values.st2.packs.images }}
11291042 - name : st2-packs-vol
11301043 mountPath : /opt/stackstorm/packs
11311044 readOnly : true
@@ -1158,11 +1071,8 @@ spec:
11581071 path : stanley_rsa
11591072 # 0400 file permission
11601073 mode : 256
1161- {{- if .Values.st2.packs.image.repository }}
1162- - name : st2-packs-vol
1163- emptyDir : {}
1164- - name : st2-virtualenvs-vol
1165- emptyDir : {}
1074+ {{- if .Values.st2.packs.images }}
1075+ {{- include "packs-volumes" . | indent 8 }}
11661076 {{- end }}
11671077 {{- with .Values.st2actionrunner.nodeSelector }}
11681078 nodeSelector :
@@ -1291,43 +1201,15 @@ spec:
12911201 checksum/datastore-key : {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
12921202 spec :
12931203 imagePullSecrets :
1294- {{- if .Values.st2.packs.image.pullSecret }}
1295- - name : {{ .Values.st2.packs.image.pullSecret }}
1204+ {{- if .Values.st2.packs.images }}
1205+ {{- include "packs-pullSecrets" . | indent 6 }}
12961206 {{- end }}
12971207 {{- if .Values.image.pullSecret }}
12981208 - name : {{ .Values.image.pullSecret }}
12991209 {{- end }}
13001210 initContainers :
1301- {{- if .Values.st2.packs.image.repository }}
1302- # Merge packs and virtualenvs from st2actionrunner with those from the st2.packs image
1303- # Custom packs
1304- - name : st2-custom-packs
1305- image : " {{ .Values.st2.packs.image.repository }}/{{ .Values.st2.packs.image.name }}:{{ .Values.st2.packs.image.tag }}"
1306- imagePullPolicy : {{ .Values.st2.packs.image.pullPolicy | quote }}
1307- volumeMounts :
1308- - name : st2-packs-vol
1309- mountPath : /opt/stackstorm/packs-shared
1310- - name : st2-virtualenvs-vol
1311- mountPath : /opt/stackstorm/virtualenvs-shared
1312- command :
1313- - ' sh'
1314- - ' -ec'
1315- - |
1316- /bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
1317- /bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
1318- # System packs
1319- - name : st2-system-packs
1320- image : " {{ template " imageRepository" . }}/st2actionrunner:{{ .Chart.AppVersion }}"
1321- imagePullPolicy : {{ .Values.image.pullPolicy }}
1322- volumeMounts :
1323- - name : st2-packs-vol
1324- mountPath : /opt/stackstorm/packs-shared
1325- command :
1326- - ' sh'
1327- - ' -ec'
1328- - |
1329- /bin/cp -aR /opt/stackstorm/packs/. /opt/stackstorm/packs-shared &&
1330- /bin/cp -aR /opt/stackstorm/virtualenvs/. /opt/stackstorm/virtualenvs-shared
1211+ {{- if .Values.st2.packs.images }}
1212+ {{- include "packs-initContainers" . | indent 6 }}
13311213 {{- end }}
13321214 # Sidecar container for generating st2client config with st2 username & password pair and sharing produced file with the main container
13331215 - name : generate-st2client-config
@@ -1397,7 +1279,7 @@ spec:
13971279 mountPath : /etc/st2/keys
13981280 readOnly : true
13991281 {{- end }}
1400- {{- if .Values.st2.packs.image.repository }}
1282+ {{- if .Values.st2.packs.images }}
14011283 - name : st2-packs-vol
14021284 mountPath : /opt/stackstorm/packs
14031285 readOnly : true
@@ -1450,11 +1332,8 @@ spec:
14501332 path : stanley_rsa
14511333 # 0400 file permission
14521334 mode : 256
1453- {{- if .Values.st2.packs.image.repository }}
1454- - name : st2-packs-vol
1455- emptyDir : {}
1456- - name : st2-virtualenvs-vol
1457- emptyDir : {}
1335+ {{- if .Values.st2.packs.images }}
1336+ {{- include "packs-volumes" . | indent 8 }}
14581337 {{- end }}
14591338
14601339{{ if .Values.st2chatops.enabled -}}
0 commit comments