Skip to content

Commit a51c941

Browse files
authored
feat: add lifecycle hook to helm chart (#5397)
1 parent 5c18e35 commit a51c941

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

ci/helm-chart/templates/deployment.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ spec:
6262
securityContext:
6363
runAsUser: {{ .Values.securityContext.runAsUser }}
6464
{{- end }}
65+
{{- if .Values.lifecycle.enabled }}
66+
lifecycle:
67+
{{- if .Values.lifecycle.postStart }}
68+
postStart:
69+
{{ toYaml .Values.lifecycle.postStart | nindent 14 }}
70+
{{- end }}
71+
{{- if .Values.lifecycle.preStop }}
72+
preStop:
73+
{{ toYaml .Values.lifecycle.preStop | nindent 14 }}
74+
{{- end }}
75+
{{- end }}
6576
env:
6677
{{- if .Values.extraVars }}
6778
{{ toYaml .Values.extraVars | indent 10 }}

ci/helm-chart/values.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ persistence:
127127
# existingClaim: ""
128128
# hostPath: /data
129129

130+
lifecycle:
131+
enabled: false
132+
# postStart:
133+
# exec:
134+
# command:
135+
# - /bin/bash
136+
# - -c
137+
# - curl -s -L SOME_SCRIPT | bash
138+
130139
## Enable an Specify container in extraContainers.
131140
## This is meant to allow adding code-server dependencies, like docker-dind.
132141
extraContainers: |

0 commit comments

Comments
 (0)