OpenShift, how do I give myself clutser-admin?

3/19/2020

I just started using OpenShift and have permissions problems. I am on the free trial for OpenShift 4.3.3 and cannot get my containers to run as root. I am the only user on my instance and I have admin, but it says I need cluster-admin to run the containers as root?

I tried running:

oc policy add-role-to-group cluster-admin anyuid

and that returned:

Error from server (Forbidden): rolebindings.rbac.authorization.k8s.io "cluster-admin" is forbidden: user "hustlin" (groups=["system:authenticated:oauth" "system:authenticated"]) is attempting to grant RBAC permissions not currently held:
{APIGroups:["*"], Resources:["*"], Verbs:["*"]}
{NonResourceURLs:["*"], Verbs:["*"]}

Going through OpenShift Online -> Administrator view -> User Management -> Roles -> cluster-admin -> Role Bindings, it states:

Restricted Access
You don't have access to this section due to cluster policy.
Error details

rolebindings.rbac.authorization.k8s.io is forbidden: User "hustlin" cannot list resource "rolebindings" in API group "rbac.authorization.k8s.io" at the cluster scope

I feel like it should not be this difficult for me to run a container as root. Just testing out OpenShift and I haven't been able to successfully run a single container on the platform, they all eventually go to CrashLoopBackOff.

Yes, I did try the:

oc login -u system:admin

command and it prompted me for my password before returning:

error: username system:admin is invalid for basic auth

I even tried following this guide from the OpenShift blog, but it would not recognize oadm.

-- Hustlin
containers
kubernetes
openshift
openshift-client-tools
redhat

0 Answers