Bug 1784435

Summary: Ensure leftover load balancers are deleted upon Kuryr-Controller start
Product: OpenShift Container Platform Reporter: Maysa Macedo <mdemaced>
Component: NetworkingAssignee: Maysa Macedo <mdemaced>
Networking sub component: kuryr QA Contact: Jon Uriarte <juriarte>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: unspecified CC: itbrown, juriarte, ltomasbo
Version: 4.4   
Target Milestone: ---   
Target Release: 4.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1784440 (view as bug list) Environment:
Last Closed: 2020-05-04 11:20:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1784440    

Description Maysa Macedo 2019-12-17 12:37:04 UTC
Description of problem:

When the deletion of a service is triggered and the load balancer is still being provisioned, if the Kuryr-controller restarts, the deletion
event will be gone and the load balancer remains on the cluster with no associated service.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Jon Uriarte 2019-12-24 12:57:50 UTC
Failed QA in 4.4.0-0.nightly-2019-12-20-210709 on 2019-12-13.1 OSP 13 puddle.

1. Create project, pod and service
 $ oc new-project test
 $ oc run --image kuryr/demo pod1
 $ oc expose dc/pod1 --port 80 --target-port 8080

 $ oc get pods
 NAME            READY   STATUS      RESTARTS   AGE
 pod1-1-deploy   0/1     Completed   0          88s
 pod1-1-vgw8n    1/1     Running     0          53s

 $ oc get svc
 NAME   TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
 pod1   ClusterIP   172.30.91.248   <none>        80/TCP    24s

2. Check the LB is created in Openstack
 $ openstack loadbalancer list
 +--------------------------------------+-----------+----------------------------------+---------------+---------------------+----------+
 | id                                   | name      | project_id                       | vip_address   | provisioning_status | provider |        
 +--------------------------------------+-----------+----------------------------------+---------------+---------------------+----------+
 | ...                                                                                                                                  |
 | ae520515-a2e8-4dd7-8179-168257c8bd8d | test/pod1 | e8b0db94fa684f9c93377c9ee7774677 | 172.30.91.248 | ACTIVE              | octavia  |
 +--------------------------------------+-----------+----------------------------------+---------------+---------------------+----------+

3. Delete the service
 $ oc delete svc pod1
 service "pod1" deleted 

4. Delete kuryr-controller pod during LB deletion
 $ oc -n openshift-kuryr delete pod kuryr-controller-598c6d476f-rb2fh
 pod "kuryr-controller-598c6d476f-rb2fh" deleted

 $ openstack loadbalancer list
 +--------------------------------------+-------------------------------------+--------------+---------------------+----------+
 | id                                   | name                                | vip_address  | provisioning_status | provider |        
 +--------------------------------------+-------------------------------------+--------------+---------------------+----------+
 | ...                                                                                                                        |
 | 8fc0b3cb-b811-443b-be7a-dd506aadea06 | ostest-87j2j-kuryr-api-loadbalancer | 172.30.0.1   | PENDING_DELETE      | octavia  |
 | ae520515-a2e8-4dd7-8179-168257c8bd8d | test/pod1                           | 72.30.91.248 | PENDING_DELETE      | octavia  |
 +--------------------------------------+-------------------------------------+--------------+---------------------+----------+

5. Check the LB has been deleted in Openstack, even with kuryr-controller pod restart
There is no test/pod1 load balancer in `openstack loadbalancer list` but API LB has been deleted as well when it shouldn't.

Reproducer:
- Deploy OCP
- Delete kuryr controller pod
- API LB should not be recreated

Comment 4 Itzik Brown 2020-01-27 15:57:22 UTC
4.4.0-0.nightly-2020-01-24-141203
Using OSP16 with Octavia amphora driver

1. Created a service
2. Verified the LB is in pending state
3. Delete the service
4. Verified the LB got deleted

Comment 6 errata-xmlrpc 2020-05-04 11:20:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0581