Skip to content

fix(helm): promote database ConfigMap to pre-install hook#877

Merged
ianderson-nvidia merged 1 commit intoNVIDIA:mainfrom
ianderson-nvidia:helm_db_migrate_hook
Apr 13, 2026
Merged

fix(helm): promote database ConfigMap to pre-install hook#877
ianderson-nvidia merged 1 commit intoNVIDIA:mainfrom
ianderson-nvidia:helm_db_migrate_hook

Conversation

@ianderson-nvidia
Copy link
Copy Markdown
Contributor

The carbide-api-migrate Job is a pre-install,pre-upgrade hook at weight -5. It references forge-system-carbide-database-config for DB connection details, but that ConfigMap was a regular Helm-managed resource — not a hook. Helm creates hooks before non-hook resources, so the ConfigMap didn't exist when the migration pod started, causing pod errors on every fresh
helm install.

Add Helm hook annotations to the database ConfigMap:

  • helm.sh/hook: pre-install,pre-upgrade — create the ConfigMap during hook phase alongside the migration job
  • helm.sh/hook-weight: "-10" — Create the ConfigMap before the migration job at -5
  • helm.sh/hook-delete-policy: before-hook-creation — recreate the ConfigMap on each install/upgrade
  • helm.sh/resource-policy: keep — Do not delete the ConfigMap after hook phase so the main deployment can still reference it

Closes #773

The `carbide-api-migrate` Job is a `pre-install,pre-upgrade` hook
at weight `-5`. It references `forge-system-carbide-database-config`
for DB connection details, but that ConfigMap was a regular
Helm-managed resource — not a hook. Helm creates hooks before
non-hook resources, so the ConfigMap didn't exist when the migration
pod started, causing pod errors on every fresh
`helm install`.

Add Helm hook annotations to the database ConfigMap:

- `helm.sh/hook: pre-install,pre-upgrade` — create the ConfigMap
  during hook phase alongside the migration job
- `helm.sh/hook-weight: "-10"` — Create the ConfigMap
   before the migration job at `-5`
- `helm.sh/hook-delete-policy: before-hook-creation` — recreate
  the ConfigMap on each install/upgrade
- `helm.sh/resource-policy: keep` — Do not delete the ConfigMap
   after hook phase so the main deployment can still reference it

Closes NVIDIA#773
@ianderson-nvidia ianderson-nvidia requested a review from a team as a code owner April 9, 2026 19:23
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

🔐 TruffleHog Secret Scan

No secrets or credentials found!

Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉

🔗 View scan details

🕐 Last updated: 2026-04-09 19:25:38 UTC | Commit: b6458e6

@ianderson-nvidia ianderson-nvidia merged commit 737ca02 into NVIDIA:main Apr 13, 2026
44 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.

bug: Database migration pre-install hook fails - depends on ConfigMap not yet

2 participants