From 1adc44dcee19443e55e780446e18b0ad39ca78cb Mon Sep 17 00:00:00 2001 From: David Lehuby Date: Thu, 14 Nov 2024 10:27:55 +1000 Subject: [PATCH] PM-2074 - Add Lifecycle hook to openmina-frontend --- openmina-frontend/README.md | 1 + openmina-frontend/templates/deployment.yaml | 4 ++++ openmina-frontend/values.yaml | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/openmina-frontend/README.md b/openmina-frontend/README.md index b6d8514..637f940 100644 --- a/openmina-frontend/README.md +++ b/openmina-frontend/README.md @@ -59,6 +59,7 @@ helmfile status | ingress.enabled | bool | `false` | The ingress | | ingress.hosts | list | `[{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}]` | The Ingress Hosts | | ingress.tls | list | `[]` | The Ingress TLS configuration | +| lifecycle | object | `{"preStop":{"exec":{"command":["sh","-c","sleep 15 && kill -SIGQUIT 1"]}}}` | Lifecycle hooks | | livenessProbe | string | `nil` | The arguments to pass at runtime | | nameOverride | string | `""` | Name override | | nodeSelector | object | `{}` | The node selector | diff --git a/openmina-frontend/templates/deployment.yaml b/openmina-frontend/templates/deployment.yaml index d35f914..933b44f 100644 --- a/openmina-frontend/templates/deployment.yaml +++ b/openmina-frontend/templates/deployment.yaml @@ -40,6 +40,10 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.lifecycle }} + lifecycle: + {{- toYaml . | nindent 12 }} + {{- end }} ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/openmina-frontend/values.yaml b/openmina-frontend/values.yaml index f38f74c..dfb80cb 100644 --- a/openmina-frontend/values.yaml +++ b/openmina-frontend/values.yaml @@ -146,3 +146,12 @@ tolerations: [] # -- The affinity affinity: {} + +# -- Lifecycle hooks +lifecycle: + preStop: + exec: + command: + - sh + - -c + - sleep 15 && kill -SIGQUIT 1