Merge "Delete loadbalancers and floatingips for service and ingress"

This commit is contained in:
Zuul 2019-02-07 11:04:18 +00:00 committed by Gerrit Code Review
commit 1cca9cc809
2 changed files with 10 additions and 9 deletions

View File

@ -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()

View File

@ -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: