From 519e0e38ef48463df9ab0ec882a58f2f1c6963df Mon Sep 17 00:00:00 2001 From: okozachenko Date: Thu, 3 Sep 2020 19:05:06 +0300 Subject: [PATCH] Migrate database and rpc Change-Id: Id522a7b38a707385b4a6aaff23c1a37e0a30a696 --- devstack/lib/senlin | 9 +++++++-- images/senlin/Dockerfile | 1 + openstack_operator/senlin.py | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/devstack/lib/senlin b/devstack/lib/senlin index c33cb49e..9abf4d62 100644 --- a/devstack/lib/senlin +++ b/devstack/lib/senlin @@ -57,10 +57,15 @@ function configure_senlin { fi # rpc - iniset_rpc_backend senlin $SENLIN_CONF + SENLIN_RABBITMQ_PASSWORD=$(get_data_from_secret senlin-rabbitmq openstack password) + SENLIN_RABBITMQ_USERNAME=$(get_data_from_secret senlin-rabbitmq openstack username) + iniset $SENLIN_CONF DEFAULT transport_url "rabbit://$SENLIN_RABBITMQ_USERNAME:$SENLIN_RABBITMQ_PASSWORD@rabbitmq-senlin:5672/" # Database connection - iniset $SENLIN_CONF database connection `database_connection_url senlin` + SENLIN_DATABASE_USER=$(get_data_from_secret senlin-mysql openstack USER) + SENLIN_DATABASE_PASSWORD=$(get_data_from_secret senlin-mysql openstack PASSWORD) + SENLIN_DATABASE_NAME=$(get_data_from_secret senlin-mysql openstack DATABASE) + iniset $SENLIN_CONF database connection "mysql+pymysql://$SENLIN_DATABASE_USER:$SENLIN_DATABASE_PASSWORD@senlin-mysql/$SENLIN_DATABASE_NAME?charset=utf8" # Keystone authtoken middleware #configure_auth_token_middleware $SENLIN_CONF senlin $SENLIN_AUTH_CACHE_DIR diff --git a/images/senlin/Dockerfile b/images/senlin/Dockerfile index 44c36d6c..488eac46 100644 --- a/images/senlin/Dockerfile +++ b/images/senlin/Dockerfile @@ -14,6 +14,7 @@ # limitations under the License. FROM vexxhost/python-builder as builder + FROM vexxhost/python-base AS senlin-base FROM senlin-base AS senlin-api diff --git a/openstack_operator/senlin.py b/openstack_operator/senlin.py index 418a7fbe..e4613c14 100644 --- a/openstack_operator/senlin.py +++ b/openstack_operator/senlin.py @@ -29,9 +29,12 @@ def create_or_resume(name, spec, **_): start the service up for the first time. """ - # deploy mysql for placement + # deploy mysql for senlin utils.ensure_mysql_cluster("senlin", spec["mysql"]) + # deploy rabbitmq + utils.deploy_rabbitmq("senlin") + # senlin api utils.create_or_update('senlin/api/daemonset.yml.j2', name=name, spec=spec)