Bug 2013017

Summary: Neutron Ports assigned to Completed Pods are not reused Edit
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: NetworkingAssignee: Maysa Macedo <mdemaced>
Networking sub component: kuryr QA Contact: Itay Matza <imatza>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: imatza, mdulko
Version: 4.9Keywords: Triaged
Target Milestone: ---   
Target Release: 4.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2022722 (view as bug list) Environment:
Last Closed: 2021-11-10 21:02:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2012902    
Bug Blocks: 2022722    

Comment 6 Itay Matza 2021-11-04 07:26:32 UTC
Verified in OCP 4.9.0-0.nightly-2021-11-03-043308 with Kury on top of RHOS-16.1-RHEL-8-20211007.n.1.


Verification steps:

## When a pod is in 'Completed' state, the Neutron port assigned to it remains in 'Active' state:
>$ oc get pods -n openshift-kube-apiserver -o wide | grep "NAME\|Completed" | head -n 2
>NAME                                      READY   STATUS      RESTARTS   AGE   IP               NODE                    NOMINATED NODE   READINESS GATES
>installer-6-ostest-g9jwx-master-2         0/1     Completed   0          15h   10.128.101.46    ostest-g9jwx-master-2   <none>           <none>

>$ openstack port list | grep "Name\|10.128.101.46"
>| ID                                   | Name                                            | MAC Address       | Fixed IP Addresses                                                                     | Status |
>| e185645d-9f91-40f9-bda0-31220edd9c2a |                                                 | fa:16:3e:84:92:7f | ip_address='10.128.101.46', subnet_id='86ae71de-4aec-4091-8692-cc5e4f6c2d7f'           | ACTIVE |


## Ports are reassigned to a new Pod if the namespace and the node are the same as the 'Completed' Pod:
>$ oc get pods -n openshift-kube-apiserver -o wide | grep "NAME\|10.128.101.46"
>NAME                                      READY   STATUS      RESTARTS   AGE    IP               NODE                    NOMINATED NODE   READINESS GATES
>demo-7897db69cc-gzwv6                     1/1     Running     0          40s    10.128.101.46    ostest-g9jwx-master-2   <none>           <none>
>installer-6-ostest-g9jwx-master-2         0/1     Completed   0          15h    10.128.101.46    ostest-g9jwx-master-2   <none>           <none>
>installer-8-ostest-g9jwx-master-2         0/1     Completed   0          15h    10.128.101.46    ostest-g9jwx-master-2   <none>           <none>
>revision-pruner-8-ostest-g9jwx-master-2   0/1     Completed   0          15h    10.128.101.46    ostest-g9jwx-master-2   <none>           <none>
>revision-pruner-9-ostest-g9jwx-master-2   0/1     Completed   0          15h    10.128.101.46    ostest-g9jwx-master-2   <none>           <none>


## Verify in several different namespaces - deploy new "demo" pods and make sure that ports of 'Completed' Pods are reassigned. Using the following sh:

```
completed_pods_addresses=$(oc get pods -A -o wide | grep Completed | awk '{print $7}' | grep -v "ago")
running_pods_addresses=$(oc get pods -A -o wide | grep Running | awk '{print $7}' | grep -v "ago")
openstack port list > osp_port_list
for completed_address in $completed_pods_addresses
do
        cat osp_port_list | grep $completed_address
        for running_address in $running_pods_addresses
        do
                if [ "$completed_address" == "$running_address" ]
                then
                        echo "Reused port found! The port with the following ip address - ${completed_address}."
                fi
        done
done
```

Comment 8 errata-xmlrpc 2021-11-10 21:02:21 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 (OpenShift Container Platform 4.9.6 bug fix update), 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-2021:4119