diff --git a/devstack/lib/magnum b/devstack/lib/magnum index fe48fe3b..9d542dba 100644 --- a/devstack/lib/magnum +++ b/devstack/lib/magnum @@ -113,13 +113,6 @@ 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_SERVICE_PORT/v1" \ - "$MAGNUM_SERVICE_PROTOCOL://$MAGNUM_SERVICE_HOST:$MAGNUM_SERVICE_PORT/v1" \ - "$MAGNUM_SERVICE_PROTOCOL://$MAGNUM_SERVICE_HOST:$MAGNUM_SERVICE_PORT/v1" - # Create for Kubernetes Keystone auth get_or_create_role k8s_admin get_or_create_role k8s_developer diff --git a/openstack_operator/magnum.py b/openstack_operator/magnum.py index d5047123..9eb17fab 100644 --- a/openstack_operator/magnum.py +++ b/openstack_operator/magnum.py @@ -20,6 +20,7 @@ server for the installation. """ from openstack_operator import database +from openstack_operator import identity from openstack_operator import utils @@ -30,7 +31,6 @@ def create_or_resume(name, spec, **_): start the service up for the first time. """ - # deploy mysql if "mysql" not in spec: spec["mysql"] = {} database.ensure_mysql_cluster("magnum", spec["mysql"]) @@ -54,9 +54,16 @@ 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, **_):