Skip to content

Commit

Permalink
Gracefully close kyuubi & add customer labels
Browse files Browse the repository at this point in the history
  • Loading branch information
HYBG committed Jan 15, 2025
1 parent fff1841 commit 446de17
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
24 changes: 24 additions & 0 deletions charts/kyuubi/templates/kyuubi-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ metadata:
name: {{ .Release.Name }}
labels:
{{- include "kyuubi.labels" . | nindent 4 }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
Expand Down Expand Up @@ -129,6 +132,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 }}
Expand Down
12 changes: 12 additions & 0 deletions charts/kyuubi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -305,3 +308,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\""]

0 comments on commit 446de17

Please sign in to comment.