diff --git a/magnum/common/neutron.py b/magnum/common/neutron.py index 7036f44d4e..1034b303f8 100644 --- a/magnum/common/neutron.py +++ b/magnum/common/neutron.py @@ -25,15 +25,14 @@ def delete_floatingip(context, fix_port_id, cluster): """Deletes the floating IP associated with the fix_port_id. Only delete the floating IP if it's created and associated with the - LoadBalancer type service in Kubernetes cluster. + the load balancers that corresponding to the services and ingresses in + Kubernetes cluster. This method only works with the Kubernetes cluster with - cloud-provider-openstack controller manager deployed, patched with - this PR: - https://github.com/kubernetes/cloud-provider-openstack/pull/433 + cloud-provider-openstack controller manager deployed. """ - pattern = (r'Floating IP for Kubernetes external service \w+ from cluster ' - r'%s$' % cluster.uuid) + pattern = (r'Floating IP for Kubernetes .+ from cluster %s$' % + cluster.uuid) try: n_client = clients.OpenStackClients(context).neutron() diff --git a/magnum/common/octavia.py b/magnum/common/octavia.py index 0aab5ba6fd..edaa17941a 100644 --- a/magnum/common/octavia.py +++ b/magnum/common/octavia.py @@ -52,15 +52,17 @@ def wait_for_lb_deleted(octavia_client, deleted_lbs): def delete_loadbalancers(context, cluster): - """Delete loadbalancers for k8s service. + """Delete loadbalancers for kubernetes resources. This method only works for the k8s cluster with cloud-provider-openstack manager or controller-manager patched with this PR: https://github.com/kubernetes/cloud-provider-openstack/pull/223 + + The load balancers created for kubernetes services and ingresses are + deleted. """ - pattern = (r'Kubernetes external service \w+ from cluster %s$' % - cluster.uuid) + pattern = (r'Kubernetes .+ from cluster %s$' % cluster.uuid) valid_status = ["ACTIVE", "ERROR", "PENDING_DELETE", "DELETED"] try: