From 53958e3fabb2331dcab841280d191e30e117b7d9 Mon Sep 17 00:00:00 2001 From: Michael 81877 Date: Fri, 3 Mar 2023 09:17:02 +0000 Subject: [PATCH 1/2] Add ability to configure coder container lifecycle hooks in helm chart --- helm/templates/coder.yaml | 2 ++ helm/values.yaml | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/helm/templates/coder.yaml b/helm/templates/coder.yaml index 6326a9adfb494..803ec75f2aa44 100644 --- a/helm/templates/coder.yaml +++ b/helm/templates/coder.yaml @@ -55,6 +55,8 @@ spec: imagePullPolicy: {{ .Values.coder.image.pullPolicy }} resources: {{- toYaml .Values.coder.resources | nindent 12 }} + lifecycle: + {{- toYaml .Values.coder.lifecycle | nindent 12 }} env: - name: CODER_HTTP_ADDRESS value: "0.0.0.0:8080" diff --git a/helm/values.yaml b/helm/values.yaml index be04b8bc37eb3..7b5e2bd7f2771 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -115,6 +115,18 @@ coder: # will be automatically mounted into the pod if specified, and the correct # "CODER_TLS_*" environment variables will be set for you. secretNames: [] + + # coder.lifecycle -- container lifecycle handlers for the Coder container, allowing + # for lifecycle events such as postStart and preStop events + # See: https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/ + lifecycle: + {} + # postStart: + # exec: + # command: ["/bin/sh", "-c", "echo postStart"] + # preStop: + # exec: + # command: ["/bin/sh","-c","echo preStart"] # coder.resources -- The resources to request for Coder. These are optional # and are not set by default. From 260c2529d98175565f704e5eeeb31a18575c5187 Mon Sep 17 00:00:00 2001 From: Michael 81877 Date: Fri, 3 Mar 2023 09:32:55 +0000 Subject: [PATCH 2/2] remove extraneous newline --- helm/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/values.yaml b/helm/values.yaml index 7b5e2bd7f2771..2dcd2919eaace 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -115,7 +115,7 @@ coder: # will be automatically mounted into the pod if specified, and the correct # "CODER_TLS_*" environment variables will be set for you. secretNames: [] - + # coder.lifecycle -- container lifecycle handlers for the Coder container, allowing # for lifecycle events such as postStart and preStop events # See: https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/