From 523722788fd4fbf661cce8572c529af09c34079a Mon Sep 17 00:00:00 2001 From: jasonj Date: Tue, 17 Jun 2025 14:23:48 +0800 Subject: [PATCH] [KYUUBI #7098] Add ability to annotate pods and headless service in Kyuubi helm chart ### Why are the changes needed? Support adding arbitrary annotations to Kyuubi pods and services - for example, those needed for annotation-based auto-discovery via [k8s-monitoring-helm](https://github.com/grafana/k8s-monitoring-helm/blob/main/charts/k8s-monitoring/docs/examples/features/annotation-autodiscovery/default/README.md) ### How was this patch tested? Helm chart installs with and without annotations added ### Was this patch authored or co-authored using generative AI tooling? No Closes #7098 from jasonj/master. Closes #7098 70f740d03 [jasonj] Add ability to annotate pods and headless service Authored-by: jasonj Signed-off-by: Kent Yao --- charts/kyuubi/templates/kyuubi-headless-service.yaml | 4 ++++ charts/kyuubi/templates/kyuubi-statefulset.yaml | 3 +++ charts/kyuubi/values.yaml | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/charts/kyuubi/templates/kyuubi-headless-service.yaml b/charts/kyuubi/templates/kyuubi-headless-service.yaml index 7eac7c1d0..2457c4708 100644 --- a/charts/kyuubi/templates/kyuubi-headless-service.yaml +++ b/charts/kyuubi/templates/kyuubi-headless-service.yaml @@ -21,6 +21,10 @@ metadata: name: {{ .Release.Name }}-headless labels: {{- include "kyuubi.labels" $ | nindent 4 }} + {{- with .Values.service.headless.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: type: ClusterIP clusterIP: None diff --git a/charts/kyuubi/templates/kyuubi-statefulset.yaml b/charts/kyuubi/templates/kyuubi-statefulset.yaml index ba57ca52b..62a0b02eb 100644 --- a/charts/kyuubi/templates/kyuubi-statefulset.yaml +++ b/charts/kyuubi/templates/kyuubi-statefulset.yaml @@ -40,6 +40,9 @@ spec: annotations: checksum/conf: {{ include (print $.Template.BasePath "/kyuubi-configmap.yaml") . | sha256sum }} checksum/conf-hadoop: {{ include (print $.Template.BasePath "/kyuubi-hadoop-configmap.yaml") . | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} diff --git a/charts/kyuubi/values.yaml b/charts/kyuubi/values.yaml index e70098b21..5a5640a29 100644 --- a/charts/kyuubi/values.yaml +++ b/charts/kyuubi/values.yaml @@ -27,6 +27,9 @@ replicaCount: 2 # The default policy is `OrderedReady`, alternative policy is `Parallel`. podManagementPolicy: OrderedReady +# Optional additional annotations to add to Kyuubi server pods +podAnnotations: {} + # Minimum number of seconds for which a newly created kyuubi server # should be ready without any of its container crashing for it to be considered available. minReadySeconds: 30 @@ -76,6 +79,12 @@ rbac: resources: ["pods"] verbs: ["create", "list", "delete"] +service: + # configuration of the headless service + headless: + # Optional additional annotations to add to the headless service + annotations: {} + server: # Thrift Binary protocol (HiveServer2 compatible) thriftBinary: