diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 9c45aa8a469..818169b695a 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -31,6 +31,6 @@ - + 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 }} 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