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

[4.14]OVN-Kubernetes node webhook does not allow to set k8s.ovn.org/node-mgmt-port and k8s.ovn.org/gateway-mtu-support

XMLWordPrintable

    • No
    • SDN Sprint 243, SDN Sprint 244
    • 2
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      The newly added webhook does not allow setting k8s.ovn.org/node-mgmt-port and k8s.ovn.org/gateway-mtu-support which should be allowed

      Steps to Reproduce:

      In one of the ovnkube-node pods (ovnkube-controller container) run the following:
      1. Create a kubeconfig which impersonates ovnkube-node:
        export KUBECONFIG=/tmp/kubeconfig
        kubectl config set-cluster default-cluster --server=https://${KUBERNETES_SERVICE_HOST}:6443 --certificate-authority /var/run/secrets/kubernetes.io/serviceaccount/ca.crt --embed-certs
        kubectl config set-credentials default --client-key /etc/ovn/ovnkube-node-certs/ovnkube-client-current.pem --client-certificate /etc/ovn/ovnkube-node-certs/ovnkube-client-current.pem --embed-certs
        kubectl config set-context default-system --cluster default-cluster --user default
        kubectl config use-context default-system
      
      2. Try to set k8s.ovn.org/node-mgmt-port and k8s.ovn.org/gateway-mtu-support:
        oc get node $(hostname) -o yaml > /tmp/current_node.yaml
        kubectl patch -f /tmp/current_node.yaml --type='json' --subresource=status -p='[{"op": "add", "path": "/metadata/annotations/k8s.ovn.org~1node-mgmt-port", "value":"{\"PfId\":1,\"FuncId\":1}"}]'
        kubectl patch -f /tmp/current_node.yaml --type='json' --subresource=status -p='[{"op": "add", "path": "/metadata/annotations/k8s.ovn.org~1gateway-mtu-support", "value":"true"}]'
        

      Actual results:

      Error from server (Forbidden): admission webhook "node.network-node-identity.openshift.io" denied the request: ovnkube-node on node: "pdiak-10-19-2023-kxnc6-master-1.c.openshift-gce-devel.internal" is not allowed to set the following annotations: [k8s.ovn.org/node-mgmt-port]
      Error from server (Forbidden): admission webhook "node.network-node-identity.openshift.io" denied the request: ovnkube-node on node: "pdiak-10-19-2023-kxnc6-master-1.c.openshift-gce-devel.internal" is not allowed to set the following annotations: [k8s.ovn.org/gateway-mtu-support]
      

      Expected results:

      Setting k8s.ovn.org/node-mgmt-port and k8s.ovn.org/gateway-mtu-support annotations should succeed

      Additional info:

      Missing annotations are only used in DPU deployments so it should be easier to verify it with the steps provided above.

              pdiak@redhat.com Patryk Diak
              pdiak@redhat.com Patryk Diak
              Ying Wang Ying Wang
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: