Skip to content

CCINFRA-12540 Add Helm hooks to jobs for automatic recreation on deploy#130

Merged
igoralveslima merged 1 commit intomainfrom
CCINFRA-12540
Feb 5, 2026
Merged

CCINFRA-12540 Add Helm hooks to jobs for automatic recreation on deploy#130
igoralveslima merged 1 commit intomainfrom
CCINFRA-12540

Conversation

@igoralveslima
Copy link
Contributor

Summary

  • Fixes Job deployment failures caused by Kubernetes Job immutability
  • Adds Helm hook annotations to automatically delete old jobs before creating new ones
  • Jobs now support configurable hook behavior (hook type, weight, delete policy)

Changes

  • Added helm.sh/hook annotation to jobs.yaml (defaults to pre-upgrade,pre-install)
  • Added helm.sh/hook-delete-policy annotation (defaults to before-hook-creation)
  • Added helm.sh/hook-weight annotation for execution order control (defaults to "0")
  • Bumped chart version from 1.8.20 to 1.8.21

Technical Details

Kubernetes Jobs are immutable resources - once created, their spec cannot be changed. Previously, when job definitions changed between deploys, Helm would attempt to update the existing Job, causing failures.

This change adds Helm hook annotations that:

  1. Run jobs during the pre-upgrade/pre-install lifecycle phase
  2. Delete old jobs before creating new ones
  3. Allow job definitions to be updated on each deploy

This matches the pattern already used in pre-release-job.yaml.

Configuration

Jobs can override the default hook behavior:

jobs:
  - name: my-job
    command: ['echo', 'hello']
    hook: "pre-upgrade,pre-install"  # optional
    hookWeight: "0"                   # optional
    hookDeletePolicy: "before-hook-creation"  # optional

🤖 Generated with Claude Code

Kubernetes Jobs are immutable and cannot be updated, causing deployment
failures when job definitions change. This adds Helm hook annotations to
jobs.yaml to automatically delete old jobs before creating new ones.

Changes:
- Add helm.sh/hook annotations (pre-upgrade, pre-install)
- Add helm.sh/hook-delete-policy (before-hook-creation)
- Add configurable hookWeight for execution order
- Bump chart version to 1.8.21

This matches the pattern already used in pre-release-job.yaml and ensures
jobs can be updated on each deploy without conflicts.

Co-Authored-By: Claude <noreply@anthropic.com>
@igoralveslima igoralveslima merged commit 14a2080 into main Feb 5, 2026
1 check passed
@igoralveslima igoralveslima deleted the CCINFRA-12540 branch February 5, 2026 14:51
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.

1 participant