From 492d1652fa10b40868e68c3d4f9039e4aec97ffa Mon Sep 17 00:00:00 2001 From: okozachenko Date: Tue, 4 Aug 2020 21:36:06 +0300 Subject: [PATCH] Add endpoint and service to glance Change-Id: Iba7f64ccf772cf8ed07a7fd8eaf49124db405d2b --- devstack/lib/glance | 6 ++++++ devstack/plugin.sh | 3 +-- openstack_operator/glance.py | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/devstack/lib/glance b/devstack/lib/glance index 6a2b8bc6..5237ba4c 100644 --- a/devstack/lib/glance +++ b/devstack/lib/glance @@ -120,6 +120,12 @@ function configure_glance { fi } +# create_glance_accounts() - Set up common required glance accounts +function create_glance_accounts { + create_service_user "glance" +} +export -f create_glance_accounts + # init_glance() function init_glance { # Delete existing images diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 657bcc5b..c7772297 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -39,8 +39,7 @@ elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then # After ceph devstack plugin kubectl create secret generic glance-config -n openstack \ --from-file=/etc/glance/glance-api.conf \ - --from-file=/etc/glance/glance-api-paste.ini \ - --from-file=/etc/glance/glance-swift-store.conf + --from-file=/etc/glance/glance-api-paste.ini # NOTE(Alex): Permissions here are bad but it's temporary so we don't care as much. sudo chmod -Rv 777 /etc/ceph diff --git a/openstack_operator/glance.py b/openstack_operator/glance.py index b4d98271..86e4f478 100644 --- a/openstack_operator/glance.py +++ b/openstack_operator/glance.py @@ -20,6 +20,7 @@ the appropriate deployments, Mcrouter, pod monitors and Prometheus rules. from openstack_operator import database +from openstack_operator import identity from openstack_operator import utils @@ -30,7 +31,7 @@ def create_or_resume(name, spec, **_): start the service up for the first time. """ - # deploy mysql + # deploy mysql for glance if "mysql" not in spec: database.ensure_mysql_cluster("glance", {}) else: @@ -44,9 +45,13 @@ def create_or_resume(name, spec, **_): name=name, spec=spec) utils.create_or_update('glance/service.yml.j2', name=name, spec=spec) + url = None if "ingress" in spec: utils.create_or_update('glance/ingress.yml.j2', name=name, spec=spec) + url = spec["ingress"]["host"] + identity.ensure_service(name="glance", service="image", + url=url, desc="Glance Image Service") def update(name, spec, **_):