From cffe683dc89831948babd00de4227d7eb7e1d558 Mon Sep 17 00:00:00 2001 From: Marek Skrobacki Date: Thu, 5 Dec 2024 15:24:34 +0000 Subject: [PATCH] understackdb: handle db name discrepancies In our current setup, the Kubernetes resource is called 'nova-api', but the database name is 'nova_api'. --- helm-charts/understackdb/README.md | 1 + helm-charts/understackdb/templates/databases.yaml | 1 + helm-charts/understackdb/values.yaml | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/helm-charts/understackdb/README.md b/helm-charts/understackdb/README.md index 87d1f29a1..b7be4c9a3 100644 --- a/helm-charts/understackdb/README.md +++ b/helm-charts/understackdb/README.md @@ -23,6 +23,7 @@ Helm chart to deploy MariaDB Database instances for Understack | databases | list | databases for all Understack components (horizon, ironic, nova, neutron, keystone) | list of databases to create | | databases[0].characterSet | string | `"utf8"` | database's character set | | databases[0].collate | string | `"utf8_general_ci"` | database's collation | +| databases[0].dbname | string | value of `.name` is used if unspecified. | database name override (if different from metadata.name) | | databases[0].instanceName | string | `"mariadb"` | name of the `MariaDB` cluster identifier (`.spec.metadata.name` on MariaDB resource) | | databases[0].name | required | `"glance"` | database name | | databases[0].namespace | string | openstack | namespace that `Database` record will be created in | diff --git a/helm-charts/understackdb/templates/databases.yaml b/helm-charts/understackdb/templates/databases.yaml index 285b0c17a..8b4608328 100644 --- a/helm-charts/understackdb/templates/databases.yaml +++ b/helm-charts/understackdb/templates/databases.yaml @@ -10,6 +10,7 @@ spec: name: {{ $.Values.instanceName }} waitForIt: true characterSet: {{ .characterSet | default "utf8" }} + name: {{ .dbname | default .name }} collate: {{ .collate | default "utf8_general_ci" }} retryInterval: {{ .retryInterval | default "5s" }} {{- with .extraConfig }} diff --git a/helm-charts/understackdb/values.yaml b/helm-charts/understackdb/values.yaml index c193e061b..7b8709362 100644 --- a/helm-charts/understackdb/values.yaml +++ b/helm-charts/understackdb/values.yaml @@ -96,6 +96,9 @@ databases: # -- namespace that `Database` record will be created in # @default -- openstack namespace: openstack + # -- database name override (if different from metadata.name) + # @default -- value of `.name` is used if unspecified. + dbname: # -- name of the `MariaDB` cluster identifier (`.spec.metadata.name` on MariaDB resource) instanceName: mariadb # -- database's character set @@ -111,7 +114,9 @@ databases: - name: neutron - name: nova - name: nova-api + dbname: nova_api - name: nova-cell0 + dbname: nova_cell0 - name: placement # -- list of databases to create