CreateContainerError: Permission Denied for Configmap-Mounted Script in RHOCP 4

Solution Verified - Updated -

Issue

  • Pods are failing with CreateContianerError due to the missing/incorrect permission for executing the script mounted from the configmap:
$ oc get pods httpd-767657bb99-5fbzx

NAME                     READY   STATUS                 RESTARTS   AGE
httpd-767657bb99-5fbzx   0/1     CreateContainerError   0          81s

$ oc describe pod httpd-767657bb99-5fbzx

  Warning  Failed          12s                kubelet            Error: container create failed: time="2023-07-27T19:46:12Z" level=error msg="runc create failed: unable to start container process: exec: \"/opt/hello-world.sh\": permission denied"

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