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

'oc get egressip' command's output is incorrect

XMLWordPrintable

    • No
    • 3
    • SDN Sprint 242, OSDOCS Sprint 257
    • 2
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • N/A
    • Release Note Not Required

      Description of problem:
      When I create a egress IP instance with 2 egress IP addresses, only one egress IP address is appeared in the output of 'oc get egressip command':

      NAME EGRESSIPS ASSIGNED NODE ASSIGNED EGRESSIPS
      egressips-prod 192.168.1.60 worker-2.ocp4.yhuang.com 192.168.1.60

      Confirmed all of the egress IP informations with REST API:

      $ curl -H "Authorization: Bearer $token" https://api.ocp4.yhuang.com:6443/apis/k8s.ovn.org/v1/egressips?limit=500 -k
      {
      "apiVersion": "k8s.ovn.org/v1",
      "items": [
      {
      "apiVersion": "k8s.ovn.org/v1",
      "kind": "EgressIP",
      "metadata": {
      "annotations": {
      "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"k8s.ovn.org/v1\",\"kind\":\"EgressIP\",\"metadata\":{\"annotations\":{},\"name\":\"egressips-prod\"},\"spec\":{\"egressIPs\":[\"192.168.1.60\",\"192.168.1.61\"],\"namespaceSelector\":{\"matchLabels\":{\"env\":\"prod\"}}}}\n"
      },
      "creationTimestamp": "2023-09-21T07:20:49Z",
      "generation": 5,
      "managedFields": [
      {
      "apiVersion": "k8s.ovn.org/v1",
      "fieldsType": "FieldsV1",
      "fieldsV1": {
      "f:metadata": {
      "f:annotations": {
      ".": {},
      "f:kubectl.kubernetes.io/last-applied-configuration": {}
      }
      },
      "f:spec": {
      ".": {},
      "f:egressIPs": {},
      "f:namespaceSelector": {
      ".": {},
      "f:matchLabels": {
      ".": {},
      "f:env": {}
      }
      }
      }
      },
      "manager": "kubectl-client-side-apply",
      "operation": "Update",
      "time": "2023-09-21T07:20:49Z"
      },
      {
      "apiVersion": "k8s.ovn.org/v1",
      "fieldsType": "FieldsV1",
      "fieldsV1": {
      "f:status": {
      ".": {},
      "f:items": {}
      }
      },
      "manager": "master-2.ocp4.yhuang.com",
      "operation": "Update",
      "time": "2023-09-21T09:12:18Z"
      }
      ],
      "name": "egressips-prod",
      "resourceVersion": "38452225",
      "uid": "abf87343-0d4a-45d1-aca3-40bf9a281232"
      },
      "spec": {
      "egressIPs": [
      "192.168.1.60",
      "192.168.1.61"
      ],
      "namespaceSelector": {
      "matchLabels":

      { "env": "prod" }

      }
      },
      "status": {
      "items": [

      { "egressIP": "192.168.1.60", "node": "worker-2.ocp4.yhuang.com" }

      ,

      { "egressIP": "192.168.1.61", "node": "worker-1.ocp4.yhuang.com" }

      ]
      }
      }
      ],
      "kind": "EgressIPList",
      "metadata":

      { "continue": "", "resourceVersion": "38500444" }

      }

      When I removed label 'k8s.ovn.org/egress-assignable=' from the node which appeared in the 'oc get egressip' output, the egress IP mapping is incorrect like below:

      $ oc label node worker-2.ocp4.yhuang.com k8s.ovn.org/egress-assignable-
      node/worker-2.ocp4.yhuang.com unlabeled

      $ oc get eip
      NAME EGRESSIPS ASSIGNED NODE ASSIGNED EGRESSIPS
      egressips-prod 192.168.1.60 worker-1.ocp4.yhuang.com 192.168.1.61

      The output was not changed when I relabeled 'k8s.ovn.org/egress-assignable=' to the worker-2.

      $ oc label node worker-2.ocp4.yhuang.com k8s.ovn.org/egress-assignable=
      node/worker-2.ocp4.yhuang.com labeled

      $ oc get eip
      NAME EGRESSIPS ASSIGNED NODE ASSIGNED EGRESSIPS
      egressips-prod 192.168.1.60 worker-1.ocp4.yhuang.com 192.168.1.61

      $ oc get eip -o yaml
      apiVersion: v1
      items:

      • apiVersion: k8s.ovn.org/v1
        kind: EgressIP
        metadata:
        annotations:
        kubectl.kubernetes.io/last-applied-configuration: |
        {"apiVersion":"k8s.ovn.org/v1","kind":"EgressIP","metadata":{"annotations":{},"name":"egressips-prod"},"spec":{"egressIPs":["192.168.1.60","192.168.1.61"],"namespaceSelector":{"matchLabels":{"env":"prod"}}}}
        creationTimestamp: "2023-09-21T07:20:49Z"
        generation: 7
        name: egressips-prod
        resourceVersion: "38504336"
        uid: abf87343-0d4a-45d1-aca3-40bf9a281232
        spec:
        egressIPs:
      • 192.168.1.60
      • 192.168.1.61
        namespaceSelector:
        matchLabels:
        env: prod
        status:
        items:
      • egressIP: 192.168.1.61
        node: worker-1.ocp4.yhuang.com
      • egressIP: 192.168.1.60
        node: worker-2.ocp4.yhuang.com
        kind: List
        metadata:
        resourceVersion: ""

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

      
      

      oc 4.12.32

      How reproducible:

      Steps to Reproduce:
      1. Create an egressIP instance with 2 egress IP addresses
      2. Label 'k8s.ovn.org/egress-assignable=' to two nodes
      3. Run 'oc get egressip'

      Actual results:
      Only one egress IP address can be seen via 'oc get egressIP' command

      Expected results:
      All of the egress IP addresses can be seen

              rhn-support-stevsmit Steven Smith
              rhn-support-yhuang Ying Huang
              Huiran Wang Huiran Wang
              Arnab Ghosh
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: