From 12a5a0afbdb882519f191123670e79c16eab8979 Mon Sep 17 00:00:00 2001 From: HYBG Date: Fri, 20 Sep 2024 15:59:35 +0800 Subject: [PATCH 1/3] Gracefully close kyuubi & add customer labels --- .idea/vcs.xml | 24 ++---------------------- charts/kyuubi/values.yaml | 12 ++++++++++++ 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 9c45aa8a469..221e673c9f6 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,36 +1,16 @@ - - + - + \ No newline at end of file diff --git a/charts/kyuubi/values.yaml b/charts/kyuubi/values.yaml index 23e5e7fdc41..36ea062f2aa 100644 --- a/charts/kyuubi/values.yaml +++ b/charts/kyuubi/values.yaml @@ -22,6 +22,9 @@ # Kyuubi server numbers replicaCount: 2 +# Kyuubi labels +labels: ~ + # controls how Kyuubi server pods are created during initial scale up, # when replacing pods on nodes, or when scaling down. # The default policy is `OrderedReady`, alternative policy is `Parallel`. @@ -304,3 +307,12 @@ metrics: enabled: false # Content of Prometheus rule file groups: [] + +# Kyuubi lifecycle +lifecycle: + postStart: + exec: + command: ['sh', '-c', "echo \"ok!!!\""] + preStop: + exec: + command: ["/bin/sh","-c","/opt/kyuubi/bin/kyuubi-ctl delete server --host $(hostname -I) --port \"10009\""] \ No newline at end of file From fd6a45f50e479832fe02abc0349b776028c117cf Mon Sep 17 00:00:00 2001 From: HYBG Date: Fri, 20 Sep 2024 15:59:52 +0800 Subject: [PATCH 2/3] Gracefully close kyuubi & add customer labels --- .../kyuubi/templates/kyuubi-statefulset.yaml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/charts/kyuubi/templates/kyuubi-statefulset.yaml b/charts/kyuubi/templates/kyuubi-statefulset.yaml index caea7d251b2..2984d0304db 100644 --- a/charts/kyuubi/templates/kyuubi-statefulset.yaml +++ b/charts/kyuubi/templates/kyuubi-statefulset.yaml @@ -21,6 +21,9 @@ metadata: name: {{ .Release.Name }} labels: {{- include "kyuubi.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: selector: matchLabels: @@ -115,6 +118,27 @@ spec: {{- with .Values.volumeMounts }} {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} + lifecycle: + {{- if .Values.lifecycle.postStart }} + postStart: + {{- if .Values.lifecycle.postStart.exec }} + exec: + {{- if .Values.lifecycle.postStart.exec.command }} + command: + {{- toYaml .Values.lifecycle.postStart.exec.command | nindent 16 }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.lifecycle.preStop }} + preStop: + {{- if .Values.lifecycle.preStop.exec }} + exec: + {{- if .Values.lifecycle.preStop.exec.command }} + command: + {{- toYaml .Values.lifecycle.preStop.exec.command | nindent 16 }} + {{- end }} + {{- end }} + {{- end }} {{- with .Values.containers }} {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} From 9098a0473dc7ff2c707bce8009f8885212b73829 Mon Sep 17 00:00:00 2001 From: HYBG Date: Wed, 9 Oct 2024 13:44:43 +0800 Subject: [PATCH 3/3] Gracefully close kyuubi & add customer labels --- .idea/vcs.xml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 221e673c9f6..bb7c7cb968d 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,16 +1,36 @@ + - + \ No newline at end of file