Skip to content

Commit 99b784e

Browse files
committed
feat(keystone): let the MariaDB operator render the database connection
Convert keystone the same way as neutron, placement and glance: the chart declares the Database, User, Grant and Connection resources and the operator-written keystone-db-conn secret is projected into the API, the db-sync job and the credential-rotate cronjob (credential_migrate touches the database) instead of generating a [database] connection from KEYSTONE_DB_PASSWORD. Bump the keystone chart to 2026.2.3, which carries the mariadb_db values. components/keystone/keystone-mariadb-db.yaml is removed and KEYSTONE_DB_PASSWORD is dropped from openstack-secrets.tpl.yaml.
1 parent b5ffb3a commit 99b784e

6 files changed

Lines changed: 33 additions & 60 deletions

File tree

‎changelog.d/20261016_120000_doug.goldstein_mariadb_operator_db_conn.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
Services are moving to get their `[database] connection` from the MariaDB operator instead of from a `<SERVICE>_DB_PASSWORD` Helm value. For each converted service the chart renders the `Database`, `User`, `Grant` and `Connection` resources, and the operator writes the connection string into the `<service>-db-conn` Secret, which is projected into every workload of that service that talks to the database. The service's `components/<service>/<service>-mariadb-db.yaml` is removed.
44

5-
Converted so far: Neutron, Placement, Glance.
5+
Converted so far: Neutron, Placement, Glance, Keystone.
66

77
The `<service>-db-password` Secret (`username` and `password` keys) is still read from your deploy repo, and the chart no longer renders it, so it must exist before this change syncs. Pods wait for `<service>-db-conn`, so a missing Secret shows up as pods stuck in `ContainerCreating`.
88

99
Argo CD prunes the old `Grant` named `<service>-grant`; the chart's is named `<service>`. Check that both are Ready after the sync:
1010

1111
```bash
12-
SERVICE=neutron # or placement, glance
12+
SERVICE=neutron # or placement, glance, keystone
1313
kubectl -n openstack get database,user,grant,connection -l application=$SERVICE
1414
```
1515

1616
The old `<service>-grant` can get stuck terminating. With `privileges: [ALL]` and `grantOption: true`, the operator's finalizer fails on delete with `Error 1064 ... near 'ON `<service>`.* FROM '<service>'@'%''` (seen on mariadb-operator 25.8.4). If `<service>-grant` is still present with a `deletionTimestamp`, revoke the privileges by hand and then remove the finalizer so the object can go away:
1717

1818
```bash
19-
SERVICE=neutron # or placement, glance
19+
SERVICE=neutron # or placement, glance, keystone
2020
kubectl mariadb -n openstack mariadb -e "REVOKE ALL PRIVILEGES, GRANT OPTION FROM '$SERVICE'@'%';"
2121
kubectl -n openstack patch grant $SERVICE-grant --type=merge -p '{"metadata":{"finalizers":null}}'
2222
```

‎charts/argocd-understack/values.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ site:
356356
wave: 1
357357
# -- Chart version for Keystone
358358
# renovate: datasource=helm depName=keystone registryUrl=https://tarballs.opendev.org/openstack/openstack-helm
359-
chartVersion: 2026.1.61+a39ebbeb1
359+
chartVersion: 2026.2.3+b5078da51
360360

361361
# -- Glance (Image Service)
362362
glance:

‎components/keystone/keystone-mariadb-db.yaml‎

Lines changed: 0 additions & 52 deletions
This file was deleted.

‎components/keystone/kustomization.yaml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
44

55
resources:
6-
- keystone-mariadb-db.yaml
76
- keystone-rabbitmq-queue.yaml

‎components/keystone/values.yaml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ dependencies:
3131
- keystone-fernet-setup
3232

3333
pod:
34+
etcSources:
35+
keystone_api:
36+
- secret:
37+
name: keystone-db-conn
38+
keystone_db_sync:
39+
- secret:
40+
name: keystone-db-conn
41+
# credential_rotate runs credential_migrate, which re-encrypts rows in the
42+
# database
43+
keystone_credential_rotate:
44+
- secret:
45+
name: keystone-db-conn
3446
resources:
3547
enabled: true
3648
api:
@@ -174,6 +186,11 @@ pod:
174186

175187
conf:
176188
keystone:
189+
database:
190+
# The MariaDB operator writes the connection string into the
191+
# keystone-db-conn secret, which is projected into the config directory
192+
# above, so the chart must not generate one from the DB password.
193+
connection: null
177194
auth:
178195
methods: password,token,openid,mapped,application_credential
179196
openid:
@@ -339,7 +356,19 @@ endpoints:
339356
default: 5556
340357
path: ''
341358

359+
# The chart declares the Database, User, Grant and Connection resources instead
360+
# of the db-init job. The password is read from the keystone-db-password secret
361+
# in the deploy repo rather than rendered from Helm values.
362+
mariadb_db:
363+
api_group: k8s.mariadb.com
364+
# the MariaDB resource is named mariadb, while clients connect through the
365+
# mariadb-primary service set in endpoints.oslo_db.hosts
366+
mariadb_ref: mariadb
367+
password_secret:
368+
create: false
369+
342370
manifests:
371+
mariadb_db: true
343372
job_credential_cleanup: false
344373
job_db_init: false
345374
job_rabbit_init: false

‎components/openstack-secrets.tpl.yaml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ endpoints:
2121
# 'oslo_db' is for MariaDB
2222
oslo_db:
2323
auth:
24-
# this is what the keystone service uses to connect to MariaDB
25-
keystone:
26-
password: "${KEYSTONE_DB_PASSWORD}"
2724
# this is what the ironic service uses to connect to MariaDB
2825
ironic:
2926
password: "${IRONIC_DB_PASSWORD}"

0 commit comments

Comments
 (0)