From 9dfaf265e0c4823f75603225f7f5322af27dedea Mon Sep 17 00:00:00 2001 From: DH Kim Date: Mon, 25 Jul 2022 12:03:07 +0900 Subject: [PATCH] Add lifecycle hook Signed-off-by: DH Kim --- ci/helm-chart/templates/deployment.yaml | 11 +++++++++++ ci/helm-chart/values.yaml | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/ci/helm-chart/templates/deployment.yaml b/ci/helm-chart/templates/deployment.yaml index 3a5e45166fe4..57dbd3ac2524 100644 --- a/ci/helm-chart/templates/deployment.yaml +++ b/ci/helm-chart/templates/deployment.yaml @@ -62,6 +62,17 @@ spec: securityContext: runAsUser: {{ .Values.securityContext.runAsUser }} {{- end }} + {{- if .Values.lifecycle.enabled }} + lifecycle: + {{- if .Values.lifecycle.postStart }} + postStart: + {{ toYaml .Values.lifecycle.postStart | nindent 14 }} + {{- end }} + {{- if .Values.lifecycle.preStop }} + preStop: + {{ toYaml .Values.lifecycle.preStop | nindent 14 }} + {{- end }} + {{- end }} env: {{- if .Values.extraVars }} {{ toYaml .Values.extraVars | indent 10 }} diff --git a/ci/helm-chart/values.yaml b/ci/helm-chart/values.yaml index 509eadd15569..37fc7a60e1ac 100644 --- a/ci/helm-chart/values.yaml +++ b/ci/helm-chart/values.yaml @@ -127,6 +127,15 @@ persistence: # existingClaim: "" # hostPath: /data +lifecycle: + enabled: false + # postStart: + # exec: + # command: + # - /bin/bash + # - -c + # - curl -s -L SOME_SCRIPT | bash + ## Enable an Specify container in extraContainers. ## This is meant to allow adding code-server dependencies, like docker-dind. extraContainers: |