Revert endpoint and service stuff

- Remove from magnum, heat, and glance
- Change identity operator

Change-Id: I9318bfdc59132cda6c4969e10258c21b0f3b8fcf
This commit is contained in:
okozachenko 2020-08-05 16:01:06 +03:00
parent a3c3252b8f
commit 66e0cae16b
6 changed files with 22 additions and 29 deletions

View File

@ -120,12 +120,6 @@ 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

@ -113,6 +113,13 @@ function create_magnum_accounts {
create_service_user "magnum" "admin"
get_or_create_service "magnum" "container-infra" "Container Infrastructure Management Service"
get_or_create_endpoint "container-infra" \
"$REGION_NAME" \
"$MAGNUM_SERVICE_PROTOCOL://$MAGNUM_SERVICE_HOST/magnum-api/v1" \
"$MAGNUM_SERVICE_PROTOCOL://$MAGNUM_SERVICE_HOST/magnum-api/v1" \
"$MAGNUM_SERVICE_PROTOCOL://$MAGNUM_SERVICE_HOST/magnum-api/v1"
# Create for Kubernetes Keystone auth
get_or_create_role k8s_admin
get_or_create_role k8s_developer

View File

@ -20,7 +20,6 @@ the appropriate deployments, Mcrouter, pod monitors and Prometheus rules.
from openstack_operator import database
from openstack_operator import identity
from openstack_operator import utils
@ -45,13 +44,10 @@ 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, **_):

View File

@ -26,12 +26,8 @@ from openstack_operator import utils
def create_or_resume(name, spec, **_):
"""Create and re-sync any Heat instances
This function is called when a new resource is created but also when we
start the service up for the first time.
"""
# deploy mysql
if "mysql" not in spec:
database.ensure_mysql_cluster("heat", {})
else:

View File

@ -22,25 +22,32 @@ import kopf
from openstack_operator import utils
def ensure_service(name, service, desc, url=None):
def ensure_service(name, service_type, desc, url=None, path=""):
"""Create or update service and endpoints
name: service name
service_type: service type
desc: service descriptioin
url: hostname of public endpoint
path: sub path of endpoint
"""
try:
# Create or resume service
utils.create_or_update('identity/service.yml.j2', name=name,
type=service, description=desc)
type=service_type, description=desc)
# Create or resume endpoints
internal_url = "http://" + name + ".openstack.svc.cluster.local"
public_url = internal_url
internal_url = public_url = \
"http://" + name + ".openstack.svc.cluster.local" + path
if url is not None:
public_url = "http://" + url
public_url = "http://" + url + path
utils.create_or_update('identity/endpoint.yml.j2',
service=service, interface='internal',
service=service_type, interface='internal',
url=internal_url)
utils.create_or_update('identity/endpoint.yml.j2',
service=service, interface='public',
service=service_type, interface='public',
url=public_url)
except Exception as ex:
raise kopf.TemporaryError(str(ex), delay=5)

View File

@ -20,7 +20,6 @@ server for the installation.
"""
from openstack_operator import database
from openstack_operator import identity
from openstack_operator import utils
@ -55,15 +54,9 @@ def create_or_resume(name, spec, **_):
utils.create_or_update('magnum/service.yml.j2',
name=name)
url = None
if "ingress" in spec:
utils.create_or_update('magnum/ingress.yml.j2',
name=name, spec=spec)
url = spec["ingress"]["host"]
# Create service and endpoints
identity.ensure_service(name="magnum-api", service="container-infra",
url=url, desc="Container Infrastructure \
Management Service")
def update(name, spec, **_):