Skip to content

Add job.podAnnotations for the pods created by the chart's Jobs - #722

Merged
lhotari merged 3 commits into
apache:masterfrom
Laurianti:job-pod-annotations
Oct 6, 2026
Merged

lhotari merged 3 commits into
apache:masterfrom
Laurianti:job-pod-annotations

Conversation

@Laurianti

@Laurianti Laurianti commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #689

Motivation

job.annotations is applied to the Job objects only, not to the pods they create. Annotations that act on pods, such as sidecar.istio.io/inject: "false" to keep an Istio sidecar from holding a Job open after its container exits, can't be set for the chart's Jobs.

Modifications

  • Add job.podAnnotations (default {}) to values.yaml.
  • Render it in the pod template of every Job: bookie-init, pulsar-init, jwt-secret-init and the broker and zookeeper sts-cleanup Jobs. The two sts-cleanup Jobs get a pod metadata block only when annotations are set.
  • Set job.podAnnotations in .ci/templates-all-values.yaml, so the all-values CI render covers the new blocks.

Verifying this change

  • helm lint passes.
  • With --set-string 'job.podAnnotations.sidecar\.istio\.io/inject=false' (and the options that enable all five Jobs), helm template puts the annotation on the pod template of each Job. With .ci/templates-all-values.yaml, all five rendered Jobs carry it.
  • Without job.podAnnotations, the rendered manifests are the same as on master, apart from the randomly generated secrets and certificates.
  • Make sure that the change passes the CI checks.

Copilot AI balanced review requested due to automatic review settings October 2, 2026 15:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Pulsar Manager remains unsupported while its removal is unmerged, and the new rendering branch lacks automated coverage.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds configurable annotations to pods created by chart Jobs.

Changes:

  • Adds job.podAnnotations.
  • Applies annotations to five Job pod templates.
File Description
charts/​pulsar/​values.yaml Defines the new setting.
charts/​pulsar/​templates/​zookeeper-statefulset-upgrade.yaml Annotates cleanup pods.
charts/​pulsar/​templates/​pulsar-cluster-initialize.yaml Annotates initialization pods.
charts/​pulsar/​templates/​jwt-secret-init.yaml Annotates JWT initialization pods.
charts/​pulsar/​templates/​broker-statefulset-upgrade.yaml Annotates cleanup pods.
charts/​pulsar/​templates/​bookkeeper-cluster-initialize.yaml Annotates initialization pods.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread charts/pulsar/templates/pulsar-cluster-initialize.yaml
Comment thread charts/pulsar/values.yaml
@lhotari

lhotari commented Oct 3, 2026

Copy link
Copy Markdown
Member

Pulsar Manager has now been removed in #718. Please rebase / merge origin/master and resolve conflicts.

@Laurianti
Laurianti force-pushed the job-pod-annotations branch from 6a908e5 to 427aeda Compare October 3, 2026 06:08
@Laurianti

Copy link
Copy Markdown
Contributor Author

Rebased on master in 427aeda. With Pulsar Manager gone, the Pulsar Manager Job change is dropped, and job.podAnnotations covers the five Jobs left.

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for adding this and for the quick rebase. The Pulsar Manager Job is gone and job.podAnnotations now covers the five remaining Jobs. Rendering with the all-values CI file produces the annotation on all five Job pod templates, and nothing is added with the default empty value.

@lhotari
lhotari merged commit edaa7d6 into apache:master Oct 6, 2026
41 checks passed
lhotari added a commit to mouchar/pulsar-helm-chart that referenced this pull request Oct 6, 2026
Resolve conflicts with the nodeAffinity support (apache#711) and
job.podAnnotations (apache#722) changes by keeping both: the sts-cleanup hook
pod templates get the component labels and the optional job pod
annotations, and the pod security context is combined with the
imagePullSecrets, scheduling and nodeAffinity settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a way to add annotations to batch/v1 / Job object templates

3 participants