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

[OCP 4.11] Capabilities are not honored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • None
    • 4.11
    • Node / CRI-O
    • Important
    • None
    • False
    • Hide

      None

      Show
      None
    • Customer Escalated

      Description of problem:

      Can not run "ip link set lo down" inside OCP 4.11 Pod even though the capabilities have been set against the binary

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

      OpenShift 4.11

      How reproducible:

      100%

      Steps to Reproduce:

      1. Create such Dockerfile
      
      FROM registry.access.redhat.com/ubi8/ubi:8.5 
      RUN dnf install -y iputils net-tools iproute 
      RUN setcap cap_net_admin+ep /usr/sbin/ip 
      CMD sleep infinity 
      
      2. Create such Pod
      
      apiVersion: v1
      kind: Pod
      metadata:
        name: testpod
      spec:
        containers:
        - name: appcntr1
          image: quay.io/rhn_support_cchen/iplink:v1.0 # iplink:v1.0 is built with the above Dockerfile
          imagePullPolicy: IfNotPresent
          command: [ "/bin/bash", "-c", "--" ]
          args: [ "while true; do sleep 300000; done;" ]
          securityContext:
            runAsGroup: 9999
            runAsUser: 9999
            capabilities:
              add: ["NET_ADMIN"]
      
      3. Check the result
       
      $ oc get pods
      NAME      READY   STATUS    RESTARTS   AGE
      testpod   1/1     Running   0          5m17s
      $ oc rsh testpod ip link set lo up
      RTNETLINK answers: Operation not permitted 

      Actual results:

      $ oc rsh testpod ip link set lo up
      RTNETLINK answers: Operation not permitted 

      Expected results:

      ip link set lo up should succeed

      Additional info:

      This issue is blocking Nokia to run test on OCP 4.11 for their solution

              pehunt@redhat.com Peter Hunt
              rhn-support-cchen Chen Chen
              Min Li Min Li
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated:
                Resolved: