I can add users to the cluster-role "cluster-admin" with:
oc adm policy add-cluster-role-to-user cluster-admin <user>
But how can I list all users with the role cluster-admin?
Environment: OpenShift 3.x
I can add users to the cluster-role "cluster-admin" with:
oc adm policy add-cluster-role-to-user cluster-admin <user>
But how can I list all users with the role cluster-admin?
Environment: OpenShift 3.x
Found it myself:
It's in the
RoleBinding[cluster-admins]:
section of:With
jq
you can get the list of users in one command:For OpenShift 3.7 and newer:
in openshift 3.9 the cluster admins are located in different dictionaries(cluster-admin-0,cluster-admin-1, and so on). To list them:
From my side command for Openshift 3.7+ is for cluster-admins :
For cluster-reader role :
Openshift 4.8