|
60 | 60 | - 'sh'
|
61 | 61 | - '-ec'
|
62 | 62 | - printf "${ST2_AUTH_USERNAME}:$(openssl passwd -apr1 "${ST2_AUTH_PASSWORD}")\n" > /tmp/st2/htpasswd
|
| 63 | + terminationGracePeriodSeconds: {{ .Values.st2auth.terminationGracePeriodSeconds | default 30 }} |
63 | 64 | containers:
|
64 | 65 | - name: st2auth
|
65 | 66 | image: '{{ template "stackstorm-ha.imageRepository" . }}/st2auth:{{ tpl (.Values.st2auth.image.tag | default .Values.image.tag) . }}'
|
|
96 | 97 | mountPath: /post-start.sh
|
97 | 98 | subPath: post-start.sh
|
98 | 99 | lifecycle:
|
| 100 | + preStop: |
| 101 | + exec: # https://blog.laputa.io/graceful-shutdown-in-kubernetes-85f1c8d586da |
| 102 | + # kubeproxy and kubelet both race |
| 103 | + # wait a bit to ensure kubeproxy has removed the iptables rule. |
| 104 | + command: [ "sleep", {{ .Values.st2auth.preStopSleep | toString }} ] |
99 | 105 | postStart:
|
100 | 106 | exec:
|
101 | 107 | command: ["/bin/bash", "/post-start.sh"]
|
@@ -179,6 +185,7 @@ spec:
|
179 | 185 | {{- if and .Values.st2.packs.images (not .Values.st2.packs.volumes.enabled) }}
|
180 | 186 | {{- include "stackstorm-ha.packs-initContainers" . | nindent 6 }}
|
181 | 187 | {{- end }}
|
| 188 | + terminationGracePeriodSeconds: {{ .Values.st2api.terminationGracePeriodSeconds | default 30 }} |
182 | 189 | containers:
|
183 | 190 | - name: st2api
|
184 | 191 | image: '{{ template "stackstorm-ha.imageRepository" . }}/st2api:{{ tpl (.Values.st2api.image.tag | default .Values.image.tag) . }}'
|
@@ -220,6 +227,11 @@ spec:
|
220 | 227 | mountPath: /post-start.sh
|
221 | 228 | subPath: post-start.sh
|
222 | 229 | lifecycle:
|
| 230 | + preStop: |
| 231 | + exec: # https://blog.laputa.io/graceful-shutdown-in-kubernetes-85f1c8d586da |
| 232 | + # kubeproxy and kubelet both race |
| 233 | + # wait a bit to ensure kubeproxy has removed the iptables rule. |
| 234 | + command: [ "sleep", {{ .Values.st2api.preStopSleep | toString }} ] |
223 | 235 | postStart:
|
224 | 236 | exec:
|
225 | 237 | command: ["/bin/bash", "/post-start.sh"]
|
@@ -305,6 +317,7 @@ spec:
|
305 | 317 | initContainers:
|
306 | 318 | {{- include "stackstorm-ha.init-containers-wait-for-db" . | nindent 6 }}
|
307 | 319 | {{- include "stackstorm-ha.init-containers-wait-for-mq" . | nindent 6 }}
|
| 320 | + terminationGracePeriodSeconds: {{ .Values.st2stream.terminationGracePeriodSeconds | default 30 }} |
308 | 321 | containers:
|
309 | 322 | - name: st2stream
|
310 | 323 | image: '{{ template "stackstorm-ha.imageRepository" . }}/st2stream:{{ tpl (.Values.st2stream.image.tag | default .Values.image.tag) . }}'
|
@@ -337,6 +350,11 @@ spec:
|
337 | 350 | mountPath: /post-start.sh
|
338 | 351 | subPath: post-start.sh
|
339 | 352 | lifecycle:
|
| 353 | + preStop: |
| 354 | + exec: # https://blog.laputa.io/graceful-shutdown-in-kubernetes-85f1c8d586da |
| 355 | + # kubeproxy and kubelet both race |
| 356 | + # wait a bit to ensure kubeproxy has removed the iptables rule. |
| 357 | + command: [ "sleep", {{ .Values.st2stream.preStopSleep | toString }} ] |
340 | 358 | postStart:
|
341 | 359 | exec:
|
342 | 360 | command: ["/bin/bash", "/post-start.sh"]
|
@@ -405,6 +423,7 @@ spec:
|
405 | 423 | {{- if .Values.image.pullSecret }}
|
406 | 424 | - name: {{ .Values.image.pullSecret }}
|
407 | 425 | {{- end }}
|
| 426 | + terminationGracePeriodSeconds: {{ .Values.st2web.terminationGracePeriodSeconds | default 30 }} |
408 | 427 | containers:
|
409 | 428 | - name: st2web
|
410 | 429 | image: '{{ template "stackstorm-ha.imageRepository" . }}/st2web:{{ tpl (.Values.st2web.image.tag | default .Values.image.tag) . }}'
|
@@ -457,6 +476,11 @@ spec:
|
457 | 476 | mountPath: /post-start.sh
|
458 | 477 | subPath: post-start.sh
|
459 | 478 | lifecycle:
|
| 479 | + preStop: |
| 480 | + exec: # https://blog.laputa.io/graceful-shutdown-in-kubernetes-85f1c8d586da |
| 481 | + # kubeproxy and kubelet both race |
| 482 | + # wait a bit to ensure kubeproxy has removed the iptables rule. |
| 483 | + command: [ "sleep", {{ .Values.st2web.preStopSleep | toString }} ] |
460 | 484 | postStart:
|
461 | 485 | exec:
|
462 | 486 | command: ["/bin/bash", "/post-start.sh"]
|
|
0 commit comments