From 73f8926468dae8df1525a6f458b3f3efbf5feb21 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Mon, 29 Jan 2024 21:30:08 -0600 Subject: [PATCH] Refactor: Move service resources into a standalone deployment This change moves service resources like mariadb and rabbitmq for our openstack services into a standalone deployment. This will ensure that we've good separation between required resources and our openstack deployments. Signed-off-by: Kevin Carter --- .../base/cinder-mariadb-database.yaml | 0 .../base/cinder-rabbitmq-queue.yaml | 0 .../cinder-resources/base/kustomization.yaml | 3 ++ kustomize/cinder/base/kustomization.yaml | 2 - .../base/glance-mariadb-database.yaml | 0 .../base/glance-rabbitmq-queue.yaml | 0 .../glance-resources/base/kustomization.yaml | 3 ++ kustomize/glance/base/kustomization.yaml | 2 - .../base/heat-mariadb-database.yaml | 0 .../base/heat-rabbitmq-queue.yaml | 0 .../heat-resources/base/kustomization.yaml | 3 ++ kustomize/heat/base/kustomization.yaml | 2 - .../base/horizon-mariadb-database.yaml | 0 .../horizon-resources/base/kustomization.yaml | 2 + kustomize/horizon/base/kustomization.yaml | 1 - .../base/keystone-mariadb-database.yaml | 0 .../base/keystone-rabbitmq-queue.yaml | 0 .../base/kustomization.yaml | 3 ++ kustomize/keystone/base/kustomization.yaml | 2 - .../neutron-resources/base/kustomization.yaml | 3 ++ .../base/neutron-mariadb-database.yaml | 0 .../base/neutron-rabbitmq-queue.yaml | 0 kustomize/neutron/base/kustomization.yaml | 2 - .../nova-resources/base/kustomization.yaml | 3 ++ .../base/nova-mariadb-database.yaml | 0 .../base/nova-rabbitmq-queue.yaml | 0 kustomize/nova/base/kustomization.yaml | 2 - .../octavia-resources/base/kustomization.yaml | 3 ++ .../base/octavia-mariadb-database.yaml | 0 .../base/octavia-rabbitmq-queue.yaml | 0 kustomize/octavia/base/kustomization.yaml | 2 - .../base/kustomization.yaml | 2 + .../base/placement-mariadb-database.yaml | 49 +++++++++++++++++++ kustomize/placement/base/kustomization.yaml | 1 - .../skyline-resources/base/kustomization.yaml | 2 + .../base/skyline-mariadb-database.yaml | 49 +++++++++++++++++++ 36 files changed, 125 insertions(+), 16 deletions(-) rename kustomize/{cinder => cinder-resources}/base/cinder-mariadb-database.yaml (100%) rename kustomize/{cinder => cinder-resources}/base/cinder-rabbitmq-queue.yaml (100%) create mode 100644 kustomize/cinder-resources/base/kustomization.yaml rename kustomize/{glance => glance-resources}/base/glance-mariadb-database.yaml (100%) rename kustomize/{glance => glance-resources}/base/glance-rabbitmq-queue.yaml (100%) create mode 100644 kustomize/glance-resources/base/kustomization.yaml rename kustomize/{heat => heat-resources}/base/heat-mariadb-database.yaml (100%) rename kustomize/{heat => heat-resources}/base/heat-rabbitmq-queue.yaml (100%) create mode 100644 kustomize/heat-resources/base/kustomization.yaml rename kustomize/{horizon => horizon-resources}/base/horizon-mariadb-database.yaml (100%) create mode 100644 kustomize/horizon-resources/base/kustomization.yaml rename kustomize/{keystone => keystone-resources}/base/keystone-mariadb-database.yaml (100%) rename kustomize/{keystone => keystone-resources}/base/keystone-rabbitmq-queue.yaml (100%) create mode 100644 kustomize/keystone-resources/base/kustomization.yaml create mode 100644 kustomize/neutron-resources/base/kustomization.yaml rename kustomize/{neutron => neutron-resources}/base/neutron-mariadb-database.yaml (100%) rename kustomize/{neutron => neutron-resources}/base/neutron-rabbitmq-queue.yaml (100%) create mode 100644 kustomize/nova-resources/base/kustomization.yaml rename kustomize/{nova => nova-resources}/base/nova-mariadb-database.yaml (100%) rename kustomize/{nova => nova-resources}/base/nova-rabbitmq-queue.yaml (100%) create mode 100644 kustomize/octavia-resources/base/kustomization.yaml rename kustomize/{octavia => octavia-resources}/base/octavia-mariadb-database.yaml (100%) rename kustomize/{octavia => octavia-resources}/base/octavia-rabbitmq-queue.yaml (100%) create mode 100644 kustomize/placement-resources/base/kustomization.yaml create mode 100644 kustomize/placement-resources/base/placement-mariadb-database.yaml create mode 100644 kustomize/skyline-resources/base/kustomization.yaml create mode 100644 kustomize/skyline-resources/base/skyline-mariadb-database.yaml diff --git a/kustomize/cinder/base/cinder-mariadb-database.yaml b/kustomize/cinder-resources/base/cinder-mariadb-database.yaml similarity index 100% rename from kustomize/cinder/base/cinder-mariadb-database.yaml rename to kustomize/cinder-resources/base/cinder-mariadb-database.yaml diff --git a/kustomize/cinder/base/cinder-rabbitmq-queue.yaml b/kustomize/cinder-resources/base/cinder-rabbitmq-queue.yaml similarity index 100% rename from kustomize/cinder/base/cinder-rabbitmq-queue.yaml rename to kustomize/cinder-resources/base/cinder-rabbitmq-queue.yaml diff --git a/kustomize/cinder-resources/base/kustomization.yaml b/kustomize/cinder-resources/base/kustomization.yaml new file mode 100644 index 00000000..09f0bcf7 --- /dev/null +++ b/kustomize/cinder-resources/base/kustomization.yaml @@ -0,0 +1,3 @@ +resources: + - cinder-mariadb-database.yaml + - cinder-rabbitmq-queue.yaml diff --git a/kustomize/cinder/base/kustomization.yaml b/kustomize/cinder/base/kustomization.yaml index 7489cc40..fa310745 100644 --- a/kustomize/cinder/base/kustomization.yaml +++ b/kustomize/cinder/base/kustomization.yaml @@ -1,6 +1,4 @@ resources: - - cinder-mariadb-database.yaml - - cinder-rabbitmq-queue.yaml - all.yaml - hpa-cinder-scheduler.yaml - hpa-cinder-api.yaml diff --git a/kustomize/glance/base/glance-mariadb-database.yaml b/kustomize/glance-resources/base/glance-mariadb-database.yaml similarity index 100% rename from kustomize/glance/base/glance-mariadb-database.yaml rename to kustomize/glance-resources/base/glance-mariadb-database.yaml diff --git a/kustomize/glance/base/glance-rabbitmq-queue.yaml b/kustomize/glance-resources/base/glance-rabbitmq-queue.yaml similarity index 100% rename from kustomize/glance/base/glance-rabbitmq-queue.yaml rename to kustomize/glance-resources/base/glance-rabbitmq-queue.yaml diff --git a/kustomize/glance-resources/base/kustomization.yaml b/kustomize/glance-resources/base/kustomization.yaml new file mode 100644 index 00000000..54b723f0 --- /dev/null +++ b/kustomize/glance-resources/base/kustomization.yaml @@ -0,0 +1,3 @@ +resources: + - glance-mariadb-database.yaml + - glance-rabbitmq-queue.yaml diff --git a/kustomize/glance/base/kustomization.yaml b/kustomize/glance/base/kustomization.yaml index 69fce788..ed029fe1 100644 --- a/kustomize/glance/base/kustomization.yaml +++ b/kustomize/glance/base/kustomization.yaml @@ -1,6 +1,4 @@ resources: - - glance-mariadb-database.yaml - - glance-rabbitmq-queue.yaml - all.yaml - hpa-glance-api.yaml diff --git a/kustomize/heat/base/heat-mariadb-database.yaml b/kustomize/heat-resources/base/heat-mariadb-database.yaml similarity index 100% rename from kustomize/heat/base/heat-mariadb-database.yaml rename to kustomize/heat-resources/base/heat-mariadb-database.yaml diff --git a/kustomize/heat/base/heat-rabbitmq-queue.yaml b/kustomize/heat-resources/base/heat-rabbitmq-queue.yaml similarity index 100% rename from kustomize/heat/base/heat-rabbitmq-queue.yaml rename to kustomize/heat-resources/base/heat-rabbitmq-queue.yaml diff --git a/kustomize/heat-resources/base/kustomization.yaml b/kustomize/heat-resources/base/kustomization.yaml new file mode 100644 index 00000000..6e172d1f --- /dev/null +++ b/kustomize/heat-resources/base/kustomization.yaml @@ -0,0 +1,3 @@ +resources: + - heat-mariadb-database.yaml + - heat-rabbitmq-queue.yaml diff --git a/kustomize/heat/base/kustomization.yaml b/kustomize/heat/base/kustomization.yaml index 82aec430..1b36167b 100644 --- a/kustomize/heat/base/kustomization.yaml +++ b/kustomize/heat/base/kustomization.yaml @@ -1,6 +1,4 @@ resources: - - heat-mariadb-database.yaml - - heat-rabbitmq-queue.yaml - all.yaml - hpa-heat-api.yaml - hpa-heat-cfn.yaml diff --git a/kustomize/horizon/base/horizon-mariadb-database.yaml b/kustomize/horizon-resources/base/horizon-mariadb-database.yaml similarity index 100% rename from kustomize/horizon/base/horizon-mariadb-database.yaml rename to kustomize/horizon-resources/base/horizon-mariadb-database.yaml diff --git a/kustomize/horizon-resources/base/kustomization.yaml b/kustomize/horizon-resources/base/kustomization.yaml new file mode 100644 index 00000000..22db7203 --- /dev/null +++ b/kustomize/horizon-resources/base/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - horizon-mariadb-database.yaml diff --git a/kustomize/horizon/base/kustomization.yaml b/kustomize/horizon/base/kustomization.yaml index 0c677427..457fdb75 100644 --- a/kustomize/horizon/base/kustomization.yaml +++ b/kustomize/horizon/base/kustomization.yaml @@ -1,4 +1,3 @@ resources: - - horizon-mariadb-database.yaml - all.yaml - hpa-horizon-api.yaml diff --git a/kustomize/keystone/base/keystone-mariadb-database.yaml b/kustomize/keystone-resources/base/keystone-mariadb-database.yaml similarity index 100% rename from kustomize/keystone/base/keystone-mariadb-database.yaml rename to kustomize/keystone-resources/base/keystone-mariadb-database.yaml diff --git a/kustomize/keystone/base/keystone-rabbitmq-queue.yaml b/kustomize/keystone-resources/base/keystone-rabbitmq-queue.yaml similarity index 100% rename from kustomize/keystone/base/keystone-rabbitmq-queue.yaml rename to kustomize/keystone-resources/base/keystone-rabbitmq-queue.yaml diff --git a/kustomize/keystone-resources/base/kustomization.yaml b/kustomize/keystone-resources/base/kustomization.yaml new file mode 100644 index 00000000..c4a92712 --- /dev/null +++ b/kustomize/keystone-resources/base/kustomization.yaml @@ -0,0 +1,3 @@ +resources: + - keystone-mariadb-database.yaml + - keystone-rabbitmq-queue.yaml diff --git a/kustomize/keystone/base/kustomization.yaml b/kustomize/keystone/base/kustomization.yaml index 0105ae67..25fdbd40 100644 --- a/kustomize/keystone/base/kustomization.yaml +++ b/kustomize/keystone/base/kustomization.yaml @@ -1,5 +1,3 @@ resources: - - keystone-mariadb-database.yaml - - keystone-rabbitmq-queue.yaml - all.yaml - hpa-keystone-api.yaml diff --git a/kustomize/neutron-resources/base/kustomization.yaml b/kustomize/neutron-resources/base/kustomization.yaml new file mode 100644 index 00000000..44e08cbe --- /dev/null +++ b/kustomize/neutron-resources/base/kustomization.yaml @@ -0,0 +1,3 @@ +resources: + - neutron-mariadb-database.yaml + - neutron-rabbitmq-queue.yaml diff --git a/kustomize/neutron/base/neutron-mariadb-database.yaml b/kustomize/neutron-resources/base/neutron-mariadb-database.yaml similarity index 100% rename from kustomize/neutron/base/neutron-mariadb-database.yaml rename to kustomize/neutron-resources/base/neutron-mariadb-database.yaml diff --git a/kustomize/neutron/base/neutron-rabbitmq-queue.yaml b/kustomize/neutron-resources/base/neutron-rabbitmq-queue.yaml similarity index 100% rename from kustomize/neutron/base/neutron-rabbitmq-queue.yaml rename to kustomize/neutron-resources/base/neutron-rabbitmq-queue.yaml diff --git a/kustomize/neutron/base/kustomization.yaml b/kustomize/neutron/base/kustomization.yaml index aa9cd85b..ba8171ab 100644 --- a/kustomize/neutron/base/kustomization.yaml +++ b/kustomize/neutron/base/kustomization.yaml @@ -1,6 +1,4 @@ resources: - - neutron-mariadb-database.yaml - - neutron-rabbitmq-queue.yaml - all.yaml - hpa-neutron-server.yaml diff --git a/kustomize/nova-resources/base/kustomization.yaml b/kustomize/nova-resources/base/kustomization.yaml new file mode 100644 index 00000000..5acc9979 --- /dev/null +++ b/kustomize/nova-resources/base/kustomization.yaml @@ -0,0 +1,3 @@ +resources: + - nova-mariadb-database.yaml + - nova-rabbitmq-queue.yaml diff --git a/kustomize/nova/base/nova-mariadb-database.yaml b/kustomize/nova-resources/base/nova-mariadb-database.yaml similarity index 100% rename from kustomize/nova/base/nova-mariadb-database.yaml rename to kustomize/nova-resources/base/nova-mariadb-database.yaml diff --git a/kustomize/nova/base/nova-rabbitmq-queue.yaml b/kustomize/nova-resources/base/nova-rabbitmq-queue.yaml similarity index 100% rename from kustomize/nova/base/nova-rabbitmq-queue.yaml rename to kustomize/nova-resources/base/nova-rabbitmq-queue.yaml diff --git a/kustomize/nova/base/kustomization.yaml b/kustomize/nova/base/kustomization.yaml index f13f0026..931ec2df 100644 --- a/kustomize/nova/base/kustomization.yaml +++ b/kustomize/nova/base/kustomization.yaml @@ -1,6 +1,4 @@ resources: - - nova-mariadb-database.yaml - - nova-rabbitmq-queue.yaml - all.yaml - hpa-nova-api-metadata.yaml - hpa-nova-api-osapi.yaml diff --git a/kustomize/octavia-resources/base/kustomization.yaml b/kustomize/octavia-resources/base/kustomization.yaml new file mode 100644 index 00000000..7b8d143f --- /dev/null +++ b/kustomize/octavia-resources/base/kustomization.yaml @@ -0,0 +1,3 @@ +resources: + - octavia-mariadb-database.yaml + - octavia-rabbitmq-queue.yaml diff --git a/kustomize/octavia/base/octavia-mariadb-database.yaml b/kustomize/octavia-resources/base/octavia-mariadb-database.yaml similarity index 100% rename from kustomize/octavia/base/octavia-mariadb-database.yaml rename to kustomize/octavia-resources/base/octavia-mariadb-database.yaml diff --git a/kustomize/octavia/base/octavia-rabbitmq-queue.yaml b/kustomize/octavia-resources/base/octavia-rabbitmq-queue.yaml similarity index 100% rename from kustomize/octavia/base/octavia-rabbitmq-queue.yaml rename to kustomize/octavia-resources/base/octavia-rabbitmq-queue.yaml diff --git a/kustomize/octavia/base/kustomization.yaml b/kustomize/octavia/base/kustomization.yaml index cb325669..620adfcc 100644 --- a/kustomize/octavia/base/kustomization.yaml +++ b/kustomize/octavia/base/kustomization.yaml @@ -1,6 +1,4 @@ resources: - - octavia-mariadb-database.yaml - - octavia-rabbitmq-queue.yaml - all.yaml - hpa-octavia-api.yaml - hpa-octavia-worker.yaml diff --git a/kustomize/placement-resources/base/kustomization.yaml b/kustomize/placement-resources/base/kustomization.yaml new file mode 100644 index 00000000..b91ce4a9 --- /dev/null +++ b/kustomize/placement-resources/base/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - placement-mariadb-database.yaml diff --git a/kustomize/placement-resources/base/placement-mariadb-database.yaml b/kustomize/placement-resources/base/placement-mariadb-database.yaml new file mode 100644 index 00000000..1709f6b4 --- /dev/null +++ b/kustomize/placement-resources/base/placement-mariadb-database.yaml @@ -0,0 +1,49 @@ +--- +apiVersion: mariadb.mmontes.io/v1alpha1 +kind: Database +metadata: + name: placement + namespace: openstack +spec: + # If you want the database to be created with a different name than the resource name + # name: data-custom + mariaDbRef: + name: mariadb-galera + characterSet: utf8 + collate: utf8_general_ci + retryInterval: 5s +--- +apiVersion: mariadb.mmontes.io/v1alpha1 +kind: User +metadata: + name: placement + namespace: openstack +spec: + # If you want the user to be created with a different name than the resource name + # name: user-custom + mariaDbRef: + name: mariadb-galera + passwordSecretKeyRef: + name: placement-db-password + key: password + # This field is immutable and defaults to 10, 0 means unlimited. + maxUserConnections: 0 + host: "%" + retryInterval: 5s +--- +apiVersion: mariadb.mmontes.io/v1alpha1 +kind: Grant +metadata: + name: placement-grant + namespace: openstack +spec: + mariaDbRef: + name: mariadb-galera + privileges: + - "ALL" + database: "placement" + table: "*" + username: placement + grantOption: true + host: "%" + retryInterval: 5s diff --git a/kustomize/placement/base/kustomization.yaml b/kustomize/placement/base/kustomization.yaml index 6c7d855a..1aebd53d 100644 --- a/kustomize/placement/base/kustomization.yaml +++ b/kustomize/placement/base/kustomization.yaml @@ -1,4 +1,3 @@ resources: - - placement-mariadb-database.yaml - all.yaml - hpa-placement-api.yaml diff --git a/kustomize/skyline-resources/base/kustomization.yaml b/kustomize/skyline-resources/base/kustomization.yaml new file mode 100644 index 00000000..25aae1e3 --- /dev/null +++ b/kustomize/skyline-resources/base/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - skyline-mariadb-database.yaml diff --git a/kustomize/skyline-resources/base/skyline-mariadb-database.yaml b/kustomize/skyline-resources/base/skyline-mariadb-database.yaml new file mode 100644 index 00000000..c5e1347a --- /dev/null +++ b/kustomize/skyline-resources/base/skyline-mariadb-database.yaml @@ -0,0 +1,49 @@ +--- +apiVersion: mariadb.mmontes.io/v1alpha1 +kind: Database +metadata: + name: skyline + namespace: openstack +spec: + # If you want the database to be created with a different name than the resource name + # name: data-custom + mariaDbRef: + name: mariadb-galera + characterSet: utf8 + collate: utf8_general_ci + retryInterval: 5s +--- +apiVersion: mariadb.mmontes.io/v1alpha1 +kind: User +metadata: + name: skyline + namespace: openstack +spec: + # If you want the user to be created with a different name than the resource name + # name: user-custom + mariaDbRef: + name: mariadb-galera + passwordSecretKeyRef: + name: skyline-apiserver-secrets + key: db-password + # This field is immutable and defaults to 10, 0 means unlimited. + maxUserConnections: 0 + host: "%" + retryInterval: 5s +--- +apiVersion: mariadb.mmontes.io/v1alpha1 +kind: Grant +metadata: + name: skyline-grant + namespace: openstack +spec: + mariaDbRef: + name: mariadb-galera + privileges: + - "ALL" + database: "skyline" + table: "*" + username: skyline + grantOption: true + host: "%" + retryInterval: 5s