Openshift RBAC policy to add anyuid scc to all the projects in preview environment

241 Views Asked by At

I am using OKD with Jenkinsx setup and jenkinsx creates a project dynamically based on a Pull Request created by a developer and deploys the services in that project.

But the services in those projects fails with "CrashLoopBackOff" error since the pods in those projects have insufficient permissions to access some of the read only files.

I am trying to allow the projects under preview environment to run as root using the anyuid scc.

Since the projects under preview environment are dynamically generated, I can add the policy after the project has been created.

oc adm policy add-scc-to-user anyuid -z default -n <project>

But I need a command to add anyuid scc to all the projects under preview environment before the projects has been created.

Please let me know the polcy/process to do it. Any suggestions here would be appreciated.

0

There are 0 best solutions below