Bug 2022722 - Neutron Ports assigned to Completed Pods are not reused Edit
Summary: Neutron Ports assigned to Completed Pods are not reused Edit
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 4.8
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.8.z
Assignee: Michał Dulko
QA Contact: Itay Matza
Depends On: 2013017
Blocks: 2028396
TreeView+ depends on / blocked
Reported: 2021-11-12 12:25 UTC by Maysa Macedo
Modified: 2022-01-18 13:49 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2013017
: 2028396 (view as bug list)
Last Closed: 2021-11-30 10:25:45 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github openshift kuryr-kubernetes pull 600 0 None open Bug 2022722: Make completed Pods Ports reusable 2021-11-15 10:14:51 UTC
Red Hat Product Errata RHBA-2021:4830 0 None None None 2021-11-30 10:26:09 UTC

Comment 4 Itay Matza 2021-11-29 13:42:51 UTC
Verified in OCP 4.8.22 with Kury on top of RHOS-16.1-RHEL-8-20210506.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\|" | head -n 2
>NAME                                      READY   STATUS      RESTARTS   AGE     IP              NODE                    NOMINATED NODE   READINESS GATES
>installer-4-ostest-xtg4x-master-2         0/1     Completed   0          3h16m   ostest-xtg4x-master-2   <none>           <none>

>$ openstack port list | grep "Name\|"
>| ID                                   | Name                                            | MAC Address       | Fixed IP Addresses                                                                     | Status
>| 7c39eba1-f2db-4491-92d9-e6a75285d791 |                                                 | fa:16:3e:ce:60:fa | ip_address='', subnet_id='5bdc29e1-5f3b-48c4-a674-8e5c923b3614'           | 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\|"
>NAME                                      READY   STATUS      RESTARTS   AGE     IP              NODE                    NOMINATED NODE   READINESS GATES
>demo-7897db69cc-8vg49                     1/1     Running     0          108s   ostest-xtg4x-master-2   <none>           <none>
>installer-4-ostest-xtg4x-master-2         0/1     Completed   0          3h18m   ostest-xtg4x-master-2   <none>           <none>
>installer-7-ostest-xtg4x-master-2         0/1     Completed   0          3h5m   ostest-xtg4x-master-2   <none>           <none>
>revision-pruner-4-ostest-xtg4x-master-2   0/1     Completed   0          3h17m   ostest-xtg4x-master-2   <none>           <none>
>revision-pruner-7-ostest-xtg4x-master-2   0/1     Completed   0          3h   ostest-xtg4x-master-2   <none>           <none>

## Verify in several different projects/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
        cat osp_port_list | grep $completed_address
        for running_address in $running_pods_addresses
                if [ "$completed_address" == "$running_address" ]
                        echo "Reused port found! The port with the following ip address - ${completed_address}."

Comment 6 errata-xmlrpc 2021-11-30 10:25:45 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.8.22 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.


Note You need to log in before you can comment on or make changes to this bug.