Pod fails with Error: container has runAsNonRoot and image will run as root

Solution Verified - Updated -

Issue

  • openshift-apiserver OR openshift-oauth-apiserver pods are in pending state:

    $ oc get pods -n openshift-oauth-apiserver
    NAME                        READY  STATUS   RESTARTS  AGE
    apiserver-757dc9955f-gzqq4  0/1    Pending  0         3d
    apiserver-757dc9955f-lbtds  0/1    Pending  0         3d
    apiserver-757dc9955f-np7l2  0/1    Pending  0         3d
    
    $ oc get pods -n openshift-apiserver
    NAME                        READY  STATUS   RESTARTS  AGE
    apiserver-5c7cb7648d-4mbxv  0/2    Pending  0         3d
    apiserver-5c7cb7648d-rc88g  0/2    Pending  0         3d
    apiserver-5c7cb7648d-xmkrh  0/2    Pending  0         3d
    
  • Following error can be seen in the events:

    2h38m      Warning  Failed            pod/apiserver-757dc9955f-wgx65   Error: container has runAsNonRoot and image will run as root (pod: "apiserver-757dc9955f-wgx65_openshift-oauth-apiserver(d1676105-9b1b-46f6-a3f7-8c882943f2cc)", container: fix-audit-permissions)
    

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content