From 87fca4af3b6e9ca54e8a8e973cfbfc6ea8865e8c Mon Sep 17 00:00:00 2001 From: David Lehuby Date: Wed, 25 Sep 2024 15:31:25 +1000 Subject: [PATCH] PM-2004 - Enable Lifecyle on Rosetta --- mina-rosetta/README.md | 1 + mina-rosetta/templates/deployment.yaml | 4 ++++ mina-rosetta/values.yaml | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/mina-rosetta/README.md b/mina-rosetta/README.md index ac4ad1b7..896d0ba5 100644 --- a/mina-rosetta/README.md +++ b/mina-rosetta/README.md @@ -52,6 +52,7 @@ helmfile status | ingress.enabled | bool | `false` | Enable Ingress | | ingress.hosts | list | `[{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}]` | Ingress Hosts | | ingress.tls | list | `[]` | The TLS configuration | +| lifecycle | object | `{"preStop":{"exec":{"command":["sh","-c","sleep 15 && kill -SIGQUIT 1"]}}}` | Lifecycle hooks | | nameOverride | string | `""` | The release name override | | nodeSelector | object | `{}` | Node selector labels | | podAnnotations | object | `{}` | Annotations to add to the pods | diff --git a/mina-rosetta/templates/deployment.yaml b/mina-rosetta/templates/deployment.yaml index f5567cb6..8934520c 100644 --- a/mina-rosetta/templates/deployment.yaml +++ b/mina-rosetta/templates/deployment.yaml @@ -31,6 +31,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 }} command: ["bash", "-c"] args: - | diff --git a/mina-rosetta/values.yaml b/mina-rosetta/values.yaml index bd2cbad4..41b7d3bc 100644 --- a/mina-rosetta/values.yaml +++ b/mina-rosetta/values.yaml @@ -114,3 +114,12 @@ tolerations: [] # -- Affinity rules affinity: {} + +# -- Lifecycle hooks +lifecycle: + preStop: + exec: + command: + - sh + - -c + - sleep 15 && kill -SIGQUIT 1