From 6340859fe88f57c77ce4b0f8ddbfd8243881032b Mon Sep 17 00:00:00 2001 From: Laurianti Date: Fri, 2 Oct 2026 17:30:41 +0200 Subject: [PATCH 1/2] Add job.podAnnotations for the pods created by the chart's Jobs --- charts/pulsar/templates/bookkeeper-cluster-initialize.yaml | 4 ++++ charts/pulsar/templates/broker-statefulset-upgrade.yaml | 5 +++++ charts/pulsar/templates/jwt-secret-init.yaml | 4 ++++ charts/pulsar/templates/pulsar-cluster-initialize.yaml | 4 ++++ charts/pulsar/templates/zookeeper-statefulset-upgrade.yaml | 5 +++++ charts/pulsar/values.yaml | 3 +++ 6 files changed, 25 insertions(+) diff --git a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml index 34137ebb..1fbabb60 100755 --- a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml +++ b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml @@ -41,6 +41,10 @@ spec: labels: {{- include "pulsar.template.labels" . | nindent 8 }} component: {{ .Values.bookkeeper.component }}-init + {{- with .Values.job.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- include "pulsar.imagePullSecrets" . | nindent 6 }} serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}" diff --git a/charts/pulsar/templates/broker-statefulset-upgrade.yaml b/charts/pulsar/templates/broker-statefulset-upgrade.yaml index 5552ccd4..fd49a8a4 100644 --- a/charts/pulsar/templates/broker-statefulset-upgrade.yaml +++ b/charts/pulsar/templates/broker-statefulset-upgrade.yaml @@ -87,6 +87,11 @@ metadata: spec: backoffLimit: 1 template: + {{- with .Values.job.podAnnotations }} + metadata: + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}-sts-cleanup" restartPolicy: Never diff --git a/charts/pulsar/templates/jwt-secret-init.yaml b/charts/pulsar/templates/jwt-secret-init.yaml index c4bd8b5b..7b1b1e47 100644 --- a/charts/pulsar/templates/jwt-secret-init.yaml +++ b/charts/pulsar/templates/jwt-secret-init.yaml @@ -94,6 +94,10 @@ spec: labels: {{- include "pulsar.template.labels" . | nindent 8 }} component: jwt-secret-init + {{- with .Values.job.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- include "pulsar.imagePullSecrets" . | nindent 6 }} serviceAccountName: "{{ template "pulsar.fullname" . }}-jwt-secret-init" diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index 873035cf..34557ce8 100755 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -42,6 +42,10 @@ spec: labels: {{- include "pulsar.template.labels" . | nindent 8 }} component: {{ .Values.pulsar_metadata.component }} + {{- with .Values.job.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- include "pulsar.imagePullSecrets" . | nindent 6 }} {{- if .Values.pulsar_metadata.nodeSelector }} diff --git a/charts/pulsar/templates/zookeeper-statefulset-upgrade.yaml b/charts/pulsar/templates/zookeeper-statefulset-upgrade.yaml index fa6ed661..c87029ee 100644 --- a/charts/pulsar/templates/zookeeper-statefulset-upgrade.yaml +++ b/charts/pulsar/templates/zookeeper-statefulset-upgrade.yaml @@ -87,6 +87,11 @@ metadata: spec: backoffLimit: 1 template: + {{- with .Values.job.podAnnotations }} + metadata: + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-sts-cleanup" restartPolicy: Never diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 4d1c2d81..3b0ff322 100755 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -2290,6 +2290,9 @@ dekaf: # pulsar-helm-chart/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml job: annotations: {} + # Annotations for the pods created by the chart's Jobs, for example + # sidecar.istio.io/inject: "false" so that an Istio sidecar doesn't keep a Job from completing + podAnnotations: {} ttl: enabled: false secondsAfterFinished: 3600 From 427aeda6abdd80f26f581c267d69e50a284d141c Mon Sep 17 00:00:00 2001 From: Laurianti Date: Fri, 2 Oct 2026 17:56:37 +0200 Subject: [PATCH 2/2] Render job.podAnnotations in the all-values CI render --- .ci/templates-all-values.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.ci/templates-all-values.yaml b/.ci/templates-all-values.yaml index 5638e859..06896f3f 100644 --- a/.ci/templates-all-values.yaml +++ b/.ci/templates-all-values.yaml @@ -237,9 +237,12 @@ auth: client: "admin" # ----------------------------------------------------------------------------- -# Job TTL -- exercises `if and .Values.job.ttl.enabled` in *-cluster-initialize +# Jobs -- exercises `if and .Values.job.ttl.enabled` in *-cluster-initialize +# and `with .Values.job.podAnnotations` in the Job pod templates # ----------------------------------------------------------------------------- job: + podAnnotations: + sidecar.istio.io/inject: "false" ttl: enabled: true secondsAfterFinished: 300