Skip to content

add support for custom annotations on initialization Jobs#665

Merged
lhotari merged 1 commit intoapache:masterfrom
lyuval-armosec:yuval/add-job-annotations
Mar 18, 2026
Merged

add support for custom annotations on initialization Jobs#665
lhotari merged 1 commit intoapache:masterfrom
lyuval-armosec:yuval/add-job-annotations

Conversation

@lyuval-armosec
Copy link
Copy Markdown
Contributor

Fixes #664

Motivation

When upgrading Pulsar via Helm, ArgoCD sync fails because it attempts
to update immutable fields on the initialization Jobs
(pulsar-cluster-initialize, bookkeeper-cluster-initialize,
pulsar-manager-cluster-initialize). This requires manually deleting
the Jobs before every upgrade, which is error-prone and breaks
GitOps automation.

Supporting custom annotations on these Jobs allows users to control
how their CD tooling handles them. For example:

  • Setting argocd.argoproj.io/hook: Sync and
    argocd.argoproj.io/hook-delete-policy: BeforeHookCreation causes
    ArgoCD to automatically delete and recreate the Job on each sync.
  • Setting argocd.argoproj.io/sync-options: Replace=true instructs
    ArgoCD to use kubectl replace instead of kubectl apply, avoiding
    the immutable field conflict entirely.

Modifications

  • Added .Values.job.annotations (defaults to {}) in values.yaml
    under the existing job block.
  • Applied the annotations to the metadata section of:
    • templates/pulsar-cluster-initialize.yaml
    • templates/bookkeeper-cluster-initialize.yaml
    • templates/pulsar-manager-cluster-initialize.yaml

Copy link
Copy Markdown
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution!

@lhotari lhotari merged commit d4af990 into apache:master Mar 18, 2026
35 checks passed
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 support for custom annotations on initialization Jobs

2 participants