Bug 1763278

Summary: kuryrnet and neutron resources leftovers after kuryr-controller restart
Product: OpenShift Container Platform Reporter: Luis Tomas Bolivar <ltomasbo>
Component: NetworkingAssignee: Luis Tomas Bolivar <ltomasbo>
Networking sub component: kuryr QA Contact: Jon Uriarte <juriarte>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: unspecified CC: juriarte
Version: 4.2.0Keywords: Triaged
Target Milestone: ---   
Target Release: 4.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1763279 (view as bug list) Environment:
Last Closed: 2020-01-23 11:08:20 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: 1763279    

Description Luis Tomas Bolivar 2019-10-18 16:25:44 UTC
When a namespace is deleted, kuryr-controller is in charge of
deleting its associated openstack resources (net, subnet and ports)
as well as the associated KuryrNet CRD.

As removing OpenStack resources may take some time, if the
kuryr-controller is restarted by any different reason during that
process, the resources are left behind as no new events for the
namespace (already deleted) happen after the restart.

Comment 1 Jon Uriarte 2019-10-23 10:59:09 UTC
Verified in 4.3.0-0.nightly-2019-10-22-165241 build on top of OSP 13 2019-10-01.1 puddle.

Steps:
1. Create project (namespace):
 $ oc new-project e2e-test

2. Check Kuryr resources (kuryrnets and namespace)
 $ oc get kuryrnets  | grep e2e | wc -l
 1

 $ oc get namespace  | grep e2e | wc -l
 1

3. Delete the project (namespace):
 $ oc delete project e2e-test 

4. Delete Kuryr controller pod:
 $ oc -n openshift-kuryr delete pod  kuryr-controller-c7898f449-phbms

5. Check Kuryr resources (kuryrnets and namespace)
 $ oc get kuryrnets  | grep e2e | wc -l
 1

 $ oc get namespace  | grep e2e | wc -l
 0

kuryrnets was not deleted before the pod was deleted.

6. Check the pod is started:
(shiftstack) [stack@undercloud-0 kubernetes]$ oc get pods -n openshift-kuryr 
NAME                                   READY   STATUS    RESTARTS   AGE      
kuryr-cni-7lfgw                        1/1     Running   0          18h      
kuryr-cni-dphvg                        1/1     Running   0          18h      
kuryr-cni-qw5gs                        1/1     Running   0          18h      
kuryr-cni-sxxkp                        1/1     Running   0          18h      
kuryr-cni-t5x9l                        1/1     Running   0          18h      
kuryr-cni-tf7gp                        1/1     Running   1          18h      
kuryr-controller-c7898f449-cjfmn       1/1     Running   0          5m40s

7. Check kuryrnets was deleted:
$ oc get kuryrnets  | grep e2e | wc -l
0

Comment 3 errata-xmlrpc 2020-01-23 11:08:20 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:0062