Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-39185

UDN NAD should not be removed when there is pod is using that

XMLWordPrintable

    • Moderate
    • No
    • False
    • Hide

      None

      Show
      None
    • Hide
      There is a known issue when deleting a `NetworkAttachmentDefinition` (NAD) resource created by a `UserDefinedNetwork` resource. You must check to see if a pod is referencing the NAD before deleting the NAD. The pod should be deleted before the NAD. Failure to do so can leave pods in an unexpected state. link:https://issues.redhat.com/browse/OCPBUGS-39185[(*OCPBUGS-39185*)]
      Show
      There is a known issue when deleting a `NetworkAttachmentDefinition` (NAD) resource created by a `UserDefinedNetwork` resource. You must check to see if a pod is referencing the NAD before deleting the NAD. The pod should be deleted before the NAD. Failure to do so can leave pods in an unexpected state. link: https://issues.redhat.com/browse/OCPBUGS-39185 [(* OCPBUGS-39185 *)]
    • Known Issue
    • Done

      Description of problem:

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

      How reproducible:

      Steps to Reproduce:

      1.  Create NAD for UDN on ns z1

      apiVersion: k8s.cni.cncf.io/v1
      kind: NetworkAttachmentDefinition
      metadata:
        name: l3-network-ns1
      spec:
        config: |2
         

      {             "cniVersion": "0.3.1",             "name": "l3-network-ns1",             "type": "ovn-k8s-cni-overlay",             "topology":"layer3",             "subnets": "192.168.0.0/16/24",             "mtu": 1300,             "netAttachDefName": "z1/l3-network-ns1",             "role": "primary"     }

      2.  Create test pod on namespace z1 and UDN network interface will be attached

      oc rsh -n z1 test-rc-xhzfk
      ~ $ ip a
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
          inet 127.0.0.1/8 scope host lo
             valid_lft forever preferred_lft forever
          inet6 ::1/128 scope host 
             valid_lft forever preferred_lft forever
      2: eth0@if40: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1360 qdisc noqueue state UP group default 
          link/ether 0a:58:0a:83:00:20 brd ff:ff:ff:ff:ff:ff link-netnsid 0
          inet 10.131.0.32/23 brd 10.131.1.255 scope global eth0
             valid_lft forever preferred_lft forever
          inet6 fe80::858:aff:fe83:20/64 scope link 
             valid_lft forever preferred_lft forever
      3: ovn-udn1@if41: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1300 qdisc noqueue state UP group default 
          link/ether 0a:58:c0:a8:00:03 brd ff:ff:ff:ff:ff:ff link-netnsid 0
          inet 192.168.0.3/24 brd 192.168.0.255 scope global ovn-udn1
             valid_lft forever preferred_lft forever
          inet6 fe80::858:c0ff:fea8:3/64 scope link 
             valid_lft forever preferred_lft forever 

       

      3.  Now delete the NAD

      oc delete net-attach-def l3-network-ns1 -n z1
      networkattachmentdefinition.k8s.cni.cncf.io "l3-network-ns1" deleted

       

      4.  in pod the udn interface still there

      $ oc rsh -n z1 test-rc-6z9cn
      ~ $ ip a
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
          inet 127.0.0.1/8 scope host lo
             valid_lft forever preferred_lft forever
          inet6 ::1/128 scope host 
             valid_lft forever preferred_lft forever
      2: eth0@if22: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1360 qdisc noqueue state UP group default 
          link/ether 0a:58:0a:81:02:0e brd ff:ff:ff:ff:ff:ff link-netnsid 0
          inet 10.129.2.14/23 brd 10.129.3.255 scope global eth0
             valid_lft forever preferred_lft forever
          inet6 fe80::858:aff:fe81:20e/64 scope link 
             valid_lft forever preferred_lft forever
      3: ovn-udn1@if23: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1300 qdisc noqueue state UP group default 
          link/ether 0a:58:c0:a8:01:03 brd ff:ff:ff:ff:ff:ff link-netnsid 0
          inet 192.168.1.3/24 brd 192.168.1.255 scope global ovn-udn1
             valid_lft forever preferred_lft forever
          inet6 fe80::858:c0ff:fea8:103/64 scope link 
             valid_lft forever preferred_lft forever

       

      Actual results:

      NAD was removed when there is pod is using that

      Expected results:

      NAD should not be removed when there is pod is using that

       

              ellorent Felix Enrique Llorente Pastora
              zzhao1@redhat.com Zhanqi Zhao
              Anurag Saxena Anurag Saxena
              Joe Aldinger Joe Aldinger
              Martin Kennelly
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: