Merge "Eliminate redundant endpoints in central cloud"

This commit is contained in:
Zuul 2020-04-16 16:20:19 +00:00 committed by Gerrit Code Review
commit 1190428cd5
1 changed files with 18 additions and 6 deletions

View File

@ -197,6 +197,7 @@ class SubcloudManager(manager.Manager):
if netaddr.IPAddress(endpoint_ip).version == 6:
endpoint_ip = '[' + endpoint_ip + ']'
keystone_internal_endpoint = ()
for service in m_ks_client.services_list:
if service.type == dcorch_consts.ENDPOINT_TYPE_PLATFORM:
endpoint_url = "http://{}:6385/v1".format(endpoint_ip)
@ -204,6 +205,7 @@ class SubcloudManager(manager.Manager):
if service.type == dcorch_consts.ENDPOINT_TYPE_IDENTITY:
endpoint_url = "http://{}:5000/v3".format(endpoint_ip)
endpoint_config.append((service.id, endpoint_url))
keystone_internal_endpoint += (service.id, endpoint_url)
if service.type == dcorch_consts.ENDPOINT_TYPE_PATCHING:
endpoint_url = "http://{}:5491".format(endpoint_ip)
endpoint_config.append((service.id, endpoint_url))
@ -220,12 +222,22 @@ class SubcloudManager(manager.Manager):
msg='Missing service in SystemController')
for endpoint in endpoint_config:
for iface in ['internal', 'admin']:
m_ks_client.keystone_client.endpoints.create(
endpoint[0],
endpoint[1],
interface=iface,
region=subcloud.name)
m_ks_client.keystone_client.endpoints.create(
endpoint[0],
endpoint[1],
interface='admin',
region=subcloud.name)
# Create an internal keystone endpoint as some parts of the
# Horizon such as the side panel are hard-wired to use the
# internal identity endpoint as opposed to the
# OPENSTACK_ENDPOINT_TYPE which is overwritten in StarlingX
# dashboard and set to 'admiURL' by default.
m_ks_client.keystone_client.endpoints.create(
keystone_internal_endpoint[0],
keystone_internal_endpoint[1],
interface='internal',
region=subcloud.name)
# Inform orchestrator that subcloud has been added
self.dcorch_rpc_client.add_subcloud(