Compare commits

...

3 Commits

Author SHA1 Message Date
4c8b57c968 Merge pull request 'fix: configurable root credentials for dbinit + allow dbinit for external DB' (#5) from fix/external-db-credentials-and-dbinit into main 2026-04-28 08:50:11 +00:00
7a9c1db489 fix: use configurable root credentials for dbinit job via values.yaml
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>
2026-04-28 14:17:52 +05:30
ffb6b84b3c fix: revert database.username to hades_user (Backstage overrides this value)
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>
2026-04-28 14:09:06 +05:30
2 changed files with 5 additions and 3 deletions

View File

@ -50,12 +50,12 @@ spec:
- name: MYSQL_DATABASE
value: {{ include "hades.databaseName" . | quote }}
- name: MYSQL_USER
value: {{ include "hades.databaseUsername" . | quote }}
value: {{ .Values.dbInit.mysqlUser | default "root" | quote }}
- name: MYSQL_PWD
valueFrom:
secretKeyRef:
name: {{ include "hades.databaseSecretName" . }}
key: mysql-password
key: {{ .Values.dbInit.mysqlPasswordKey | default "mysql-root-password" }}
command:
- /bin/bash
- -c

View File

@ -123,7 +123,7 @@ database:
host: "" # Will be set to mysql.fullname if mysql.enabled=true
port: "3306"
name: "hades_db"
username: "mysql_user"
username: "hades_user"
password: "" # Leave empty to auto-generate
# For external database, set mysql.enabled=false and configure above values
@ -166,6 +166,8 @@ mysql:
# Automatically runs all SQL migration files from sql/ directory in alphabetical order
dbInit:
enabled: true
mysqlUser: "root"
mysqlPasswordKey: "mysql-root-password"
# ConfigMap for application configuration files
config: