fix: configurable root credentials for dbinit + allow dbinit for external DB #5

Merged
sagar.patil merged 2 commits from fix/external-db-credentials-and-dbinit into main 2026-04-28 08:50:11 +00:00
Collaborator

Summary

  • dbinit job now uses dbInit.mysqlUser and dbInit.mysqlPasswordKey from values.yaml (defaults: root / mysql-root-password)
  • dbinit job runs for both bundled and external MySQL (removed mysql.enabled condition)
  • Reverted database.username back to hades_user (Backstage overrides it anyway)

Why

  • SQL migrations need SUPER privilege for triggers with DEFINER=root@%
  • dbinit was skipped for external MySQL, leaving empty database

Changes

  • job-dbinit.yaml: reads user/password-key from values instead of hardcoded
  • values.yaml: added dbInit.mysqlUser: root and dbInit.mysqlPasswordKey: mysql-root-password
## Summary - dbinit job now uses `dbInit.mysqlUser` and `dbInit.mysqlPasswordKey` from values.yaml (defaults: root / mysql-root-password) - dbinit job runs for both bundled and external MySQL (removed mysql.enabled condition) - Reverted database.username back to hades_user (Backstage overrides it anyway) ## Why - SQL migrations need SUPER privilege for triggers with `DEFINER=root@%` - dbinit was skipped for external MySQL, leaving empty database ## Changes - `job-dbinit.yaml`: reads user/password-key from values instead of hardcoded - `values.yaml`: added `dbInit.mysqlUser: root` and `dbInit.mysqlPasswordKey: mysql-root-password`
sagar.patil added 2 commits 2026-04-28 08:48:15 +00:00
The values.yaml database.username has no effect when Backstage deploys
with mysql.enabled=false — Backstage passes the username from the UI.
The shared MySQL init SQL needs to create hades_user separately.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dbInit.mysqlUser and dbInit.mysqlPasswordKey are now configurable in
values.yaml. Defaults to root/mysql-root-password since SQL migrations
need SUPER privilege for triggers with DEFINER=root@%.

App (hades-service) still connects as hades_user — only the migration
job uses root.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sagar.patil merged commit 4c8b57c968 into main 2026-04-28 08:50:11 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gitea_admin/hades-chart#5
No description provided.