From 707cdd9d68f223c84cd4a5d9ffb8fad0434629d2 Mon Sep 17 00:00:00 2001 From: zhipengl Date: Mon, 9 Sep 2019 22:33:44 +0800 Subject: [PATCH] Expose the novncproxy port The novncproxy would be available at the OAMIP:30680. Test pass on simplex setup. VM console can be accessed through horizon. Closes-bug: 1827246 Depends-on: https://review.opendev.org/#/c/684443/ Change-Id: I6c450d391a8842d8336a0085dc31f939cb8789d9 Signed-off-by: zhipengl (cherry picked from commit f8ec30d0c69ec0c843b8077bd892b8e932279c6c) --- .../manifests/manifest.yaml | 2 ++ sysinv/sysinv/sysinv/sysinv/helm/nova.py | 23 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/manifests/manifest.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/manifests/manifest.yaml index 3b37e84d8d..1b512a448c 100644 --- a/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/manifests/manifest.yaml +++ b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/manifests/manifest.yaml @@ -910,6 +910,8 @@ data: # here. mandatory_access_control: type: null + useHostNetwork: + novncproxy: false replicas: api_metadata: 1 osapi: 1 diff --git a/sysinv/sysinv/sysinv/sysinv/helm/nova.py b/sysinv/sysinv/sysinv/sysinv/helm/nova.py index bd9d7f2cdf..67d2b4c539 100644 --- a/sysinv/sysinv/sysinv/sysinv/helm/nova.py +++ b/sysinv/sysinv/sysinv/sysinv/helm/nova.py @@ -49,6 +49,7 @@ class NovaHelm(openstack.OpenstackBaseHelm): AUTH_USERS = ['nova', ] SERVICE_USERS = ['neutron', 'ironic', 'placement'] NOVNCPROXY_SERVICE_NAME = 'novncproxy' + NOVNCPROXY_NODE_PORT = '30680' def get_overrides(self, namespace=None): @@ -98,6 +99,11 @@ class NovaHelm(openstack.OpenstackBaseHelm): 'network': { 'sshd': { 'from_subnet': self._get_ssh_subnet(), + }, + 'novncproxy': { + 'node_port': { + 'enabled': self._get_network_node_port_overrides() + } } }, 'ceph_client': self._get_ceph_client_overrides(), @@ -196,9 +202,8 @@ class NovaHelm(openstack.OpenstackBaseHelm): location = "%s.%s" % (self.NOVNCPROXY_SERVICE_NAME, str(endpoint_domain.value).lower()) else: - location = self._get_service_default_dns_name( - self.NOVNCPROXY_SERVICE_NAME) - + location = "%s:%s" % (self._get_oam_address(), + self.NOVNCPROXY_NODE_PORT) url = "%s://%s/vnc_auto.html" % (self._get_public_protocol(), location) return url @@ -576,3 +581,15 @@ class NovaHelm(openstack.OpenstackBaseHelm): } return ephemeral_storage_conf + + def _get_network_node_port_overrides(self): + # If openstack endpoint FQDN is configured, disable node_port 30680 + # which will enable the Ingress for the novncproxy service + endpoint_fqdn = self._get_service_parameter( + constants.SERVICE_TYPE_OPENSTACK, + constants.SERVICE_PARAM_SECTION_OPENSTACK_HELM, + constants.SERVICE_PARAM_NAME_ENDPOINT_DOMAIN) + if endpoint_fqdn: + return False + else: + return True