From bb61feacfd8fae03e50b855a123af3c4c02f1c02 Mon Sep 17 00:00:00 2001 From: Guillaume Boutry Date: Fri, 10 May 2024 11:40:34 +0200 Subject: [PATCH] Remove os-*-hostname variables All traffic is either from traefik (which will handle hostname itself), or through the K8S SVC. os-*-hostname variables should not be used. Change-Id: I29b5798ed2fa7cc952ac686d7591921c678a6859 --- charms/aodh-k8s/config.yaml | 18 ------------------ charms/ceilometer-k8s/config.yaml | 18 ------------------ charms/cinder-k8s/config.yaml | 18 ------------------ .../cinder-k8s/tests/unit/test_cinder_charm.py | 4 ++++ charms/designate-k8s/config.yaml | 18 ------------------ charms/glance-k8s/config.yaml | 18 ------------------ charms/gnocchi-k8s/config.yaml | 18 ------------------ charms/heat-k8s/config.yaml | 18 ------------------ charms/horizon-k8s/config.yaml | 18 ------------------ charms/keystone-k8s/config.yaml | 18 ------------------ charms/keystone-k8s/src/charm.py | 16 ++++++---------- charms/magnum-k8s/config.yaml | 18 ------------------ charms/neutron-k8s/config.yaml | 18 ------------------ charms/nova-k8s/config.yaml | 18 ------------------ charms/octavia-k8s/config.yaml | 18 ------------------ .../openstack-images-sync-k8s/charmcraft.yaml | 18 ------------------ charms/ovn-relay-k8s/config.yaml | 11 ----------- charms/placement-k8s/config.yaml | 18 ------------------ ops-sunbeam/doc/bundles/full.yaml | 2 -- ops-sunbeam/doc/bundles/minimal.yaml | 2 -- ops-sunbeam/ops_sunbeam/charm.py | 11 +---------- ops-sunbeam/shared_code/config-api.yaml | 18 ------------------ .../{{cookiecutter.service_name}}/config.yaml | 18 ------------------ 23 files changed, 11 insertions(+), 341 deletions(-) delete mode 100644 charms/ovn-relay-k8s/config.yaml diff --git a/charms/aodh-k8s/config.yaml b/charms/aodh-k8s/config.yaml index 7254f64c..fdbee75e 100644 --- a/charms/aodh-k8s/config.yaml +++ b/charms/aodh-k8s/config.yaml @@ -3,24 +3,6 @@ options: default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: glance.juju - description: | - The hostname or address of the admin endpoints that should be advertised - in the glance image provider. - type: string - os-internal-hostname: - default: glance.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string - os-public-hostname: - default: glance.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/charms/ceilometer-k8s/config.yaml b/charms/ceilometer-k8s/config.yaml index ac6a1965..1259ca43 100644 --- a/charms/ceilometer-k8s/config.yaml +++ b/charms/ceilometer-k8s/config.yaml @@ -3,24 +3,6 @@ options: default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: glance.juju - description: | - The hostname or address of the admin endpoints that should be advertised - in the glance image provider. - type: string - os-internal-hostname: - default: glance.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string - os-public-hostname: - default: glance.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/charms/cinder-k8s/config.yaml b/charms/cinder-k8s/config.yaml index 142513c1..1259ca43 100644 --- a/charms/cinder-k8s/config.yaml +++ b/charms/cinder-k8s/config.yaml @@ -3,24 +3,6 @@ options: default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: cinder.juju - description: | - The hostname or address of the admin endpoints that should be advertised - in the cinder volume provider. - type: string - os-internal-hostname: - default: cinder.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the cinder volume provider. - type: string - os-public-hostname: - default: cinder.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the cinder volume provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/charms/cinder-k8s/tests/unit/test_cinder_charm.py b/charms/cinder-k8s/tests/unit/test_cinder_charm.py index 4ff7d581..159addfe 100644 --- a/charms/cinder-k8s/tests/unit/test_cinder_charm.py +++ b/charms/cinder-k8s/tests/unit/test_cinder_charm.py @@ -42,6 +42,10 @@ class _CinderOperatorCharm(charm.CinderOperatorCharm): super().configure_charm(event) self._log_event(event) + @property + def public_ingress_address(self): + return "cinder.juju" + class TestCinderOperatorCharm(test_utils.CharmTestCase): """Unit tests for Cinder Operator.""" diff --git a/charms/designate-k8s/config.yaml b/charms/designate-k8s/config.yaml index aeb8a5ea..ac76a241 100644 --- a/charms/designate-k8s/config.yaml +++ b/charms/designate-k8s/config.yaml @@ -3,24 +3,6 @@ options: default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: designate.juju - description: | - The hostname or address of the admin endpoints that should be advertised - in the designate image provider. - type: string - os-internal-hostname: - default: designate.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the designate image provider. - type: string - os-public-hostname: - default: designate.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the designate image provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/charms/glance-k8s/config.yaml b/charms/glance-k8s/config.yaml index 8631c2d7..ed9ee05e 100644 --- a/charms/glance-k8s/config.yaml +++ b/charms/glance-k8s/config.yaml @@ -3,24 +3,6 @@ options: default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: - description: | - The hostname or address of the admin endpoints that should be advertised - in the glance image provider. - type: string - os-internal-hostname: - default: - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string - os-public-hostname: - default: - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/charms/gnocchi-k8s/config.yaml b/charms/gnocchi-k8s/config.yaml index a8b7cae2..b1e92970 100644 --- a/charms/gnocchi-k8s/config.yaml +++ b/charms/gnocchi-k8s/config.yaml @@ -3,24 +3,6 @@ options: default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: glance.juju - description: | - The hostname or address of the admin endpoints that should be advertised - in the glance image provider. - type: string - os-internal-hostname: - default: glance.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string - os-public-hostname: - default: glance.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/charms/heat-k8s/config.yaml b/charms/heat-k8s/config.yaml index 24b14b0e..1259ca43 100644 --- a/charms/heat-k8s/config.yaml +++ b/charms/heat-k8s/config.yaml @@ -3,24 +3,6 @@ options: default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: heat.juju - description: | - The hostname or address of the admin endpoints that should be advertised - in the glance image provider. - type: string - os-internal-hostname: - default: heat.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string - os-public-hostname: - default: heat.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/charms/horizon-k8s/config.yaml b/charms/horizon-k8s/config.yaml index 0a8780b9..76445775 100644 --- a/charms/horizon-k8s/config.yaml +++ b/charms/horizon-k8s/config.yaml @@ -3,24 +3,6 @@ options: default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: glance.juju - description: | - The hostname or address of the admin endpoints that should be advertised - in the glance image provider. - type: string - os-internal-hostname: - default: glance.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string - os-public-hostname: - default: glance.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string session-timeout: type: int default: 3600 diff --git a/charms/keystone-k8s/config.yaml b/charms/keystone-k8s/config.yaml index 6945a1bf..083bfde9 100644 --- a/charms/keystone-k8s/config.yaml +++ b/charms/keystone-k8s/config.yaml @@ -24,24 +24,6 @@ options: description: Name of tenant to associate with service credentials type: string - os-admin-hostname: - default: - description: | - The hostname or address of the admin endpoints that should be advertised - in the keystone identity provider. - type: string - os-internal-hostname: - default: - description: | - The hostname or address of the internal endpoints that should be advertised - in the keystone identity provider. - type: string - os-public-hostname: - default: - description: | - The hostname or address of the internal endpoints that should be advertised - in the keystone identity provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/charms/keystone-k8s/src/charm.py b/charms/keystone-k8s/src/charm.py index ad1250e0..d93c309e 100755 --- a/charms/keystone-k8s/src/charm.py +++ b/charms/keystone-k8s/src/charm.py @@ -1392,11 +1392,9 @@ export OS_AUTH_VERSION=3 @property def admin_endpoint(self): """Admin endpoint for keystone api.""" - admin_hostname = self.model.config.get("os-admin-hostname") - if not admin_hostname: - admin_hostname = self.model.get_binding( - self.IDSVC_RELATION_NAME - ).network.ingress_address + admin_hostname = self.model.get_binding( + self.IDSVC_RELATION_NAME + ).network.ingress_address return f"http://{admin_hostname}:{self.service_port}/v3" @property @@ -1405,11 +1403,9 @@ export OS_AUTH_VERSION=3 if self.ingress_internal and self.ingress_internal.url: return self.ingress_internal.url + "/v3" - internal_hostname = self.model.config.get("os-internal-hostname") - if not internal_hostname: - internal_hostname = self.model.get_binding( - self.IDSVC_RELATION_NAME - ).network.ingress_address + internal_hostname = self.model.get_binding( + self.IDSVC_RELATION_NAME + ).network.ingress_address return f"http://{internal_hostname}:{self.service_port}/v3" @property diff --git a/charms/magnum-k8s/config.yaml b/charms/magnum-k8s/config.yaml index 245f9553..5268d6d5 100644 --- a/charms/magnum-k8s/config.yaml +++ b/charms/magnum-k8s/config.yaml @@ -13,24 +13,6 @@ options: default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: magnum.juju - description: | - The hostname or address of the admin endpoints that should be advertised - in the glance image provider. - type: string - os-internal-hostname: - default: magnum.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string - os-public-hostname: - default: magnum.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/charms/neutron-k8s/config.yaml b/charms/neutron-k8s/config.yaml index b24bcf60..174326f2 100644 --- a/charms/neutron-k8s/config.yaml +++ b/charms/neutron-k8s/config.yaml @@ -12,24 +12,6 @@ options: will not enable internal cloud dns resolution. This value should end with a '.', e.g. 'cloud.example.org.'. type: string - os-admin-hostname: - default: - description: | - The hostname or address of the admin endpoints that should be advertised - in the neutron image provider. - type: string - os-internal-hostname: - default: - description: | - The hostname or address of the internal endpoints that should be advertised - in the neutron image provider. - type: string - os-public-hostname: - default: - description: | - The hostname or address of the internal endpoints that should be advertised - in the neutron image provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/charms/nova-k8s/config.yaml b/charms/nova-k8s/config.yaml index 43d3ee02..1259ca43 100644 --- a/charms/nova-k8s/config.yaml +++ b/charms/nova-k8s/config.yaml @@ -3,24 +3,6 @@ options: default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: - description: | - The hostname or address of the admin endpoints that should be advertised - in the nova image provider. - type: string - os-internal-hostname: - default: - description: | - The hostname or address of the internal endpoints that should be advertised - in the nova image provider. - type: string - os-public-hostname: - default: - description: | - The hostname or address of the internal endpoints that should be advertised - in the nova image provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/charms/octavia-k8s/config.yaml b/charms/octavia-k8s/config.yaml index e3dbf057..1259ca43 100644 --- a/charms/octavia-k8s/config.yaml +++ b/charms/octavia-k8s/config.yaml @@ -3,24 +3,6 @@ options: default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: octavia.juju - description: | - The hostname or address of the admin endpoints that should be advertised - in the loadbalancer provider. - type: string - os-internal-hostname: - default: octavia.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the loadbalancer provider. - type: string - os-public-hostname: - default: octavia.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the loadbalancer provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/charms/openstack-images-sync-k8s/charmcraft.yaml b/charms/openstack-images-sync-k8s/charmcraft.yaml index 58ae334e..4ed9b2f2 100644 --- a/charms/openstack-images-sync-k8s/charmcraft.yaml +++ b/charms/openstack-images-sync-k8s/charmcraft.yaml @@ -48,24 +48,6 @@ config: description: | The maximum number of images to keep in sync per version. type: int - os-admin-hostname: - default: openstack-images-sync.juju - description: | - The hostname or address of the admin endpoints that should be advertised - in the openstack image sync. - type: string - os-internal-hostname: - default: openstack-images-sync.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the openstack image sync. - type: string - os-public-hostname: - default: openstack-images-sync.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the openstack image sync. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/charms/ovn-relay-k8s/config.yaml b/charms/ovn-relay-k8s/config.yaml deleted file mode 100644 index 592df270..00000000 --- a/charms/ovn-relay-k8s/config.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright 2022 Canonical Ltd. -# See LICENSE file for licensing details. -# - -options: - os-public-hostname: - default: ovn-relay.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the neutron image provider. - type: string diff --git a/charms/placement-k8s/config.yaml b/charms/placement-k8s/config.yaml index 7d88e4e7..1259ca43 100644 --- a/charms/placement-k8s/config.yaml +++ b/charms/placement-k8s/config.yaml @@ -3,24 +3,6 @@ options: default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: - description: | - The hostname or address of the admin endpoints that should be advertised - in the placement image provider. - type: string - os-internal-hostname: - default: - description: | - The hostname or address of the internal endpoints that should be advertised - in the placement image provider. - type: string - os-public-hostname: - default: - description: | - The hostname or address of the public endpoints that should be advertised - in the placement image provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/ops-sunbeam/doc/bundles/full.yaml b/ops-sunbeam/doc/bundles/full.yaml index cba32d0c..ac31d914 100644 --- a/ops-sunbeam/doc/bundles/full.yaml +++ b/ops-sunbeam/doc/bundles/full.yaml @@ -54,8 +54,6 @@ applications: channel: edge scale: 1 trust: true - options: - os-public-hostname: ovn-central: charm: ch:ovn-central-k8s channel: edge diff --git a/ops-sunbeam/doc/bundles/minimal.yaml b/ops-sunbeam/doc/bundles/minimal.yaml index ee8e6eec..ed7b96d7 100644 --- a/ops-sunbeam/doc/bundles/minimal.yaml +++ b/ops-sunbeam/doc/bundles/minimal.yaml @@ -55,8 +55,6 @@ applications: channel: edge scale: 1 trust: true - options: - os-public-hostname: ovn-central: charm: ch:ovn-central-k8s channel: edge diff --git a/ops-sunbeam/ops_sunbeam/charm.py b/ops-sunbeam/ops_sunbeam/charm.py index 990af251..11f6921d 100644 --- a/ops-sunbeam/ops_sunbeam/charm.py +++ b/ops-sunbeam/ops_sunbeam/charm.py @@ -229,12 +229,7 @@ class OSBaseOperatorCharm(ops.charm.CharmBase): def get_domain_name_sans(self) -> List[str]: """Get Domain names for service.""" - domain_name_sans = [] - for binding_config in ["admin", "internal", "public"]: - hostname = self.config.get(f"os-{binding_config}-hostname") - if hostname: - domain_name_sans.append(hostname) - return domain_name_sans + return [] def check_leader_ready(self): """Check the leader is reporting as ready.""" @@ -798,10 +793,6 @@ class OSBaseOperatorAPICharm(OSBaseOperatorCharmK8S): @property def public_ingress_address(self) -> str: """IP address or hostname for access to this service.""" - svc_hostname = self.model.config.get("os-public-hostname") - if svc_hostname: - return svc_hostname - client = Client() charm_service = client.get( Service, name=self.app.name, namespace=self.model.name diff --git a/ops-sunbeam/shared_code/config-api.yaml b/ops-sunbeam/shared_code/config-api.yaml index 8afd667b..267aa9d4 100644 --- a/ops-sunbeam/shared_code/config-api.yaml +++ b/ops-sunbeam/shared_code/config-api.yaml @@ -2,24 +2,6 @@ default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: glance.juju - description: | - The hostname or address of the admin endpoints that should be advertised - in the glance image provider. - type: string - os-internal-hostname: - default: glance.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string - os-public-hostname: - default: glance.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions diff --git a/ops-sunbeam/shared_code/sunbeam_charm/{{cookiecutter.service_name}}/config.yaml b/ops-sunbeam/shared_code/sunbeam_charm/{{cookiecutter.service_name}}/config.yaml index ac6a1965..1259ca43 100644 --- a/ops-sunbeam/shared_code/sunbeam_charm/{{cookiecutter.service_name}}/config.yaml +++ b/ops-sunbeam/shared_code/sunbeam_charm/{{cookiecutter.service_name}}/config.yaml @@ -3,24 +3,6 @@ options: default: False description: Enable debug logging. type: boolean - os-admin-hostname: - default: glance.juju - description: | - The hostname or address of the admin endpoints that should be advertised - in the glance image provider. - type: string - os-internal-hostname: - default: glance.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string - os-public-hostname: - default: glance.juju - description: | - The hostname or address of the internal endpoints that should be advertised - in the glance image provider. - type: string region: default: RegionOne description: Space delimited list of OpenStack regions