Skip to content

Commit a8e00e4

Browse files
committed
feat(neutron): let the MariaDB operator render the database connection
Have the neutron chart declare the Database, User, Grant and Connection resources and project the operator-written neutron-db-conn secret into every workload that talks to the database, instead of generating a [database] connection from the NEUTRON_DB_PASSWORD Helm value. The password is read from the existing neutron-db-password secret (mariadb_db.password_secret.create: false) and the resources attach to the MariaDB named mariadb (mariadb_ref) while clients keep connecting through the mariadb-primary service. This needs a neutron chart carrying the mariadb_db.password_secret and mariadb_db.mariadb_ref values; the chart pin must be bumped before this syncs. components/neutron/neutron-mariadb-db.yaml is no longer needed and NEUTRON_DB_PASSWORD is dropped from openstack-secrets.tpl.yaml.
1 parent 20b848e commit a8e00e4

6 files changed

Lines changed: 44 additions & 57 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### Deploy repo changes
2+
3+
Neutron now gets its `[database] connection` from the MariaDB operator instead of from the `NEUTRON_DB_PASSWORD` Helm value. The chart renders the `Database`, `User`, `Grant` and `Connection` resources, and the operator writes the connection string into the `neutron-db-conn` Secret, which is projected into every Neutron workload that talks to the database. `components/neutron/neutron-mariadb-db.yaml` is removed.
4+
5+
The `neutron-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. Neutron pods wait for `neutron-db-conn`, so a missing Secret shows up as pods stuck in `ContainerCreating`.
6+
7+
Argo CD prunes the old `Grant` named `neutron-grant`; the chart's is named `neutron`. Check that both are Ready after the sync:
8+
9+
```bash
10+
kubectl -n openstack get database,user,grant,connection -l application=neutron
11+
```
12+
13+
`NEUTRON_DB_PASSWORD` in `secret-openstack.yaml` is no longer used by Neutron and can be removed from your deploy repo once every cluster is on this version.

‎charts/argocd-understack/values.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ site:
404404
wave: 2
405405
# -- Chart version for Neutron
406406
# renovate: datasource=helm depName=neutron registryUrl=https://tarballs.opendev.org/openstack/openstack-helm
407-
chartVersion: 2026.1.107+a39ebbeb1
407+
chartVersion: 2026.2.1+b90c3a6ab
408408

409409
# -- Placement (Placement Service)
410410
placement:

‎components/neutron/kustomization.yaml‎

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

55
resources:
6-
- neutron-mariadb-db.yaml
76
- neutron-rabbitmq-queue.yaml
87
- job-neutron-post-deploy.yaml

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

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

‎components/neutron/values.yaml‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ conf:
6969
#ovn_nb_connection: "tcp:ovn-ovsdb-nb.openstack.svc:6641"
7070
#ovn_sb_connection: "tcp:ovn-ovsdb-sb.openstack.svc:6642"
7171
neutron:
72+
database:
73+
# The MariaDB operator writes the connection string into the
74+
# neutron-db-conn secret, which is projected into the config directory
75+
# below, so the chart must not generate one from the DB password.
76+
connection: null
7277
DEFAULT:
7378
# https://docs.openstack.org/neutron/latest/admin/config-wsgi.html
7479
# the api_workers set the number of uWSGI processes as well
@@ -157,21 +162,34 @@ pod:
157162
neutron_db_sync:
158163
- secret:
159164
name: neutron-ks-etc
165+
- secret:
166+
name: neutron-db-conn
160167
neutron_ironic_agent:
161168
- secret:
162169
name: neutron-ks-etc
163170
neutron_server:
164171
- secret:
165172
name: neutron-ks-etc
173+
- secret:
174+
name: neutron-db-conn
166175
neutron_ovn_maintenance_worker:
167176
- secret:
168177
name: neutron-ks-etc
178+
- secret:
179+
name: neutron-db-conn
169180
neutron_rpc_server:
170181
- secret:
171182
name: neutron-ks-etc
183+
- secret:
184+
name: neutron-db-conn
172185
neutron_periodic_worker:
173186
- secret:
174187
name: neutron-ks-etc
188+
- secret:
189+
name: neutron-db-conn
190+
neutron_ovn_db_sync:
191+
- secret:
192+
name: neutron-db-conn
175193

176194
use_fqdn:
177195
neutron_agent: false
@@ -310,8 +328,20 @@ dependencies:
310328
services: []
311329

312330

331+
# The chart declares the Database, User, Grant and Connection resources instead
332+
# of the db-init job. The password is read from the neutron-db-password secret
333+
# in the deploy repo rather than rendered from Helm values.
334+
mariadb_db:
335+
api_group: k8s.mariadb.com
336+
# the MariaDB resource is named mariadb, while clients connect through the
337+
# mariadb-primary service set in endpoints.oslo_db.hosts
338+
mariadb_ref: mariadb
339+
password_secret:
340+
create: false
341+
313342
manifests:
314343
job_db_init: false
344+
mariadb_db: true
315345
job_rabbit_init: false
316346
pod_rally_test: false
317347
secret_db: false

‎components/openstack-secrets.tpl.yaml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ endpoints:
3030
# this is what the ironic service uses to connect to MariaDB
3131
ironic:
3232
password: "${IRONIC_DB_PASSWORD}"
33-
# this is what the neutron service uses to connect to MariaDB
34-
neutron:
35-
password: "${NEUTRON_DB_PASSWORD}"
3633
# this is what the nova service uses to connect to MariaDB
3734
nova:
3835
password: "${NOVA_DB_PASSWORD}"

0 commit comments

Comments
 (0)