Add endpoint and service to glance

Change-Id: Iba7f64ccf772cf8ed07a7fd8eaf49124db405d2b
This commit is contained in:
okozachenko 2020-08-04 21:36:06 +03:00
parent 21b1d731c6
commit 492d1652fa
3 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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, **_):