This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.5.8. Creating a cluster role
You can create a cluster role.
Procedure
To create a cluster role, run the following command:
oc create clusterrole <name> --verb=<verb> --resource=<resource>
$ oc create clusterrole <name> --verb=<verb> --resource=<resource>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this command, specify:
-
<name>
, the local role’s name -
<verb>
, a comma-separated list of the verbs to apply to the role -
<resource>
, the resources that the role applies to
For example, to create a cluster role that allows a user to view pods, run the following command:
oc create clusterrole podviewonly --verb=get --resource=pod
$ oc create clusterrole podviewonly --verb=get --resource=pod
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -