Skip to content

Conversation

@ChrisPC-39
Copy link
Collaborator

@ChrisPC-39 ChrisPC-39 commented Dec 3, 2025

🧩 Fix: Add Helm Hook Annotations to Migration Job

Summary

This pull request updates the migration Job template in the Helm chart to ensure that migration jobs are properly recreated during upgrades and no longer cause immutable field errors.

Purpose:

  1. Ensures the Job runs automatically before Helm installs or upgrades the release.
  2. Instructs Helm to remove any previous migration Job before creating a new one, preventing the field is immutable error during upgrades.

🧪 Testing

Verified that a fresh helm install creates the migration Job and runs successfully.
Verified that subsequent helm upgrade commands no longer fail with the immutable field error.
Confirmed that only one migration Job exists after upgrade (old one is removed automatically).

@ChrisPC-39 ChrisPC-39 added devops DevOps activities (containers, automation, deployment, makefiles, etc) helm Helm chart labels Dec 3, 2025
@ChrisPC-39 ChrisPC-39 marked this pull request as draft December 3, 2025 11:05
@ChrisPC-39 ChrisPC-39 self-assigned this Dec 3, 2025
@ChrisPC-39 ChrisPC-39 marked this pull request as ready for review December 3, 2025 11:11
@ChrisPC-39 ChrisPC-39 marked this pull request as draft December 8, 2025 11:19
@ChrisPC-39 ChrisPC-39 marked this pull request as ready for review December 9, 2025 10:45
Add Helm hook annotations to the migration Job template to ensure proper
recreation during upgrades and prevent immutable field errors.

Changes:
- Add helm.sh/hook: pre-install,pre-upgrade to run Job before install/upgrade
- Add helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded to
  remove old Jobs and clean up succeeded ones
- Bump chart version to 0.9.1
- Update CHANGELOG with migration job fix details

This eliminates upgrade failures caused by Kubernetes rejecting changes to
immutable spec.template fields in existing Job resources.

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai merged commit b811e52 into main Dec 12, 2025
45 checks passed
@crivetimihai crivetimihai deleted the update_helm_chart branch December 12, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps activities (containers, automation, deployment, makefiles, etc) helm Helm chart

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants