Roles are collections of policy rules, which are sets of
permitted verbs that can be performed on a set of resources. OpenShift Container Platform includes
a set of default roles that can be added to users and groups in the
cluster policy or in a
local policy.
Default Role |
Description |
admin |
A project manager. If used in a
local binding, an admin user will have
rights to view any resource in the project and modify any resource in the
project except for role creation and quota. If the cluster-admin wants to
allow an admin to modify roles, the cluster-admin must create a
project-scoped Policy object using JSON. |
basic-user |
A user that can get basic information about projects and users. |
cluster-admin |
A super-user that can perform any action in any project. When
granted to a user within a local policy, they have full control over quota and
roles and every action on every resource in the project. |
cluster-status |
A user that can get basic cluster status information. |
edit |
A user that can modify most objects in a project, but does not have the
power to view or modify roles or bindings. |
self-provisioner |
A user that can create their own projects. |
view |
A user who cannot make any modifications, but can see most objects in a
project. They cannot view or modify roles or bindings. |
|
Remember that users
and groups can be associated with, or bound to, multiple roles at the same
time.
|
Cluster administrators can investigate policy roles by using the oc describe
command, which displays a matrix of the Verbs
, Non-Resource URLs
, Extension
, Resource Names
,API Groups
, and Resources
that apply to the policy role.
$ oc describe clusterrole <role>
The rule verbs apply to the objects listed in that row. For example, if the create
verb is applied to the serviceaccounts
resource, the holder is allowed to create service accounts but no other resource unless otherwise specified in the role matrix.
The verbs are described in the following table.
Table 1. Cluster and Local Policy Verbs
Verb |
Read/Write Policy |
Description |
create |
ReadWrite |
Allows for new a resource object to be created in the storage back-end. |
delete |
ReadWrite |
Allows for removal of a resource object. Depending on the specific resource, child objects may or may not be garbage collected by the server. See notes on specific resource objects for details. |
deletecollection |
ReadWrite |
Allows for resource collection deletion for namespace cleanup. |
get |
ReadOnly |
Allows for a specific resource object to be retrieved by name. |
impersonate |
ReadWrite |
Allows the holder (user, group, or userextra object) to pass requests with the policy bindings of other service accounts in that namespace. |
list |
ReadOnly |
Allows for retrieval of all resource objects of a specific type within a namespace. |
patch |
ReadWrite |
Allows for changes applied to a specific field in a resource object. How the change is merged is defined per field. Lists can either be replaced or merged; merging lists does not preserve ordering. |
proxy |
ReadWrite |
Allows for the creation of proxy server or application-level gateway between localhost and the Kubernetes API Server. |
update |
ReadWrite |
Allows for resource object to be replaced with a complete and modified configuration. |
view |
ReadOnly |
Allows the holder to retrieve job information from Jenkins builds. |
watch |
ReadOnly |
Stream results for a resource object as it is updated. Similar to a callback, watch is used to respond to resource changes. |
* |
ReadWrite |
All verbs are allowed for the specified resource object. |
The following tables show the verb-resource relationships for common
cluster and
local policy roles.
Table 2. admin Rules Matrix
create |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy horizontalpodautoscalers
cronjobs jobs scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale statefulsets rolebindings roles
localresourceaccessreviews localsubjectaccessreviews subjectrulesreviews
podsecuritypolicyreviews podsecuritypolicyselfsubjectreviews
podsecuritypolicysubjectreviews buildconfigs buildconfigs/webhooks builds
buildconfigs/instantiate buildconfigs/instantiatebinary builds/clone
deploymentconfigs deploymentconfigs/scale generatedeploymentconfigs
deploymentconfigrollbacks deploymentconfigs/instantiate
deploymentconfigs/rollback imagestreamimages imagestreammappings imagestreams
imagestreams/secrets imagestreamtags imagestreamimports routes
processedtemplates templateconfigs templates buildlogs resourceaccessreviews
subjectaccessreviews |
delete |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy horizontalpodautoscalers
cronjobs jobs scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale statefulsets rolebindings roles buildconfigs
buildconfigs/webhooks builds deploymentconfigs deploymentconfigs/scale
generatedeploymentconfigs imagestreamimages imagestreammappings imagestreams
imagestreams/secrets imagestreamtags projects routes processedtemplates
templateconfigs templates buildlogs |
deletecollection |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy horizontalpodautoscalers
cronjobs jobs scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale statefulsets rolebindings roles buildconfigs
buildconfigs/webhooks builds deploymentconfigs deploymentconfigs/scale
generatedeploymentconfigs imagestreamimages imagestreammappings imagestreams
imagestreams/secrets imagestreamtags routes processedtemplates templateconfigs
templates buildlogs |
get |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy bindings events limitranges
namespaces namespaces/status pods/log pods/status replicationcontrollers/status
resourcequotas resourcequotas/status horizontalpodautoscalers cronjobs jobs
scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale daemonsets statefulsets rolebindings roles
policies policybindings rolebindingrestrictions buildconfigs
buildconfigs/webhooks builds builds/log deploymentconfigs
deploymentconfigs/scale generatedeploymentconfigs deploymentconfigs/log
deploymentconfigs/status imagestreamimages imagestreammappings imagestreams
imagestreams/secrets imagestreamtags imagestreams/status imagestreams/layers
projects appliedclusterresourcequotas routes routes/status processedtemplates
templateconfigs templates buildlogs resourcequotausages |
impersonate |
|
list |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy bindings events limitranges
namespaces namespaces/status pods/log pods/status replicationcontrollers/status
resourcequotas resourcequotas/status horizontalpodautoscalers cronjobs jobs
scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale daemonsets statefulsets rolebindings roles
policies policybindings rolebindingrestrictions buildconfigs
buildconfigs/webhooks builds builds/log deploymentconfigs
deploymentconfigs/scale generatedeploymentconfigs deploymentconfigs/log
deploymentconfigs/status imagestreamimages imagestreammappings imagestreams
imagestreams/secrets imagestreamtags imagestreams/status
appliedclusterresourcequotas routes routes/status processedtemplates
templateconfigs templates buildlogs resourcequotausages |
patch |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy horizontalpodautoscalers
cronjobs jobs scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale statefulsets rolebindings roles buildconfigs
buildconfigs/webhooks builds deploymentconfigs deploymentconfigs/scale
generatedeploymentconfigs imagestreamimages imagestreammappings imagestreams
imagestreams/secrets imagestreamtags projects routes processedtemplates
templateconfigs templates buildlogs |
proxy |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy |
update |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy horizontalpodautoscalers
cronjobs jobs scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale statefulsets rolebindings roles buildconfigs
buildconfigs/webhooks builds deploymentconfigs deploymentconfigs/scale
generatedeploymentconfigs imagestreamimages imagestreammappings imagestreams
imagestreams/secrets imagestreamtags imagestreams/layers projects routes
routes/status processedtemplates templateconfigs templates buildlogs |
watch |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy bindings events limitranges
namespaces namespaces/status pods/log pods/status replicationcontrollers/status
resourcequotas resourcequotas/status horizontalpodautoscalers cronjobs jobs
scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale daemonsets statefulsets rolebindings roles
policies policybindings rolebindingrestrictions buildconfigs
buildconfigs/webhooks builds builds/log deploymentconfigs
deploymentconfigs/scale generatedeploymentconfigs deploymentconfigs/log
deploymentconfigs/status imagestreamimages imagestreammappings imagestreams
imagestreams/secrets imagestreamtags imagestreams/status
appliedclusterresourcequotas routes routes/status processedtemplates
templateconfigs templates buildlogs resourcequotausages |
Table 3. basic-user Rules Matrix
create |
selfsubjectrulesreviews localsubjectaccessreviews subjectaccessreviews |
get |
|
list |
projectrequests clusterroles storageclasses projects |
watch |
|
Table 4. cluster-admin Rules Matrix
* |
|
Table 5. edit Rules Matrix
create |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy horizontalpodautoscalers
cronjobs jobs scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale statefulsets buildconfigs buildconfigs/webhooks
builds buildconfigs/instantiate buildconfigs/instantiatebinary builds/clone
deploymentconfigs deploymentconfigs/scale generatedeploymentconfigs
deploymentconfigrollbacks deploymentconfigs/instantiate
deploymentconfigs/rollback imagestreamimages imagestreammappings imagestreams
imagestreams/secrets imagestreamtags imagestreamimports routes
processedtemplates templateconfigs templates buildlogs |
delete |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy horizontalpodautoscalers
cronjobs jobs scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale statefulsets buildconfigs buildconfigs/webhooks
builds deploymentconfigs deploymentconfigs/scale generatedeploymentconfigs
imagestreamimages imagestreammappings imagestreams imagestreams/secrets
imagestreamtags routes processedtemplates templateconfigs templates buildlogs |
deletecollection |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy horizontalpodautoscalers
cronjobs jobs scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale statefulsets buildconfigs buildconfigs/webhooks
builds deploymentconfigs deploymentconfigs/scale generatedeploymentconfigs
imagestreamimages imagestreammappings imagestreams imagestreams/secrets
imagestreamtags routes processedtemplates templateconfigs templates buildlogs |
get |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy bindings events limitranges
namespaces namespaces/status pods/log pods/status replicationcontrollers/status
resourcequotas resourcequotas/status horizontalpodautoscalers cronjobs jobs
scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale daemonsets statefulsets buildconfigs
buildconfigs/webhooks builds builds/log deploymentconfigs
deploymentconfigs/scale generatedeploymentconfigs deploymentconfigs/log
deploymentconfigs/status imagestreamimages imagestreammappings imagestreams
imagestreams/secrets imagestreamtags imagestreams/status imagestreams/layers
projects appliedclusterresourcequotas routes routes/status processedtemplates
templateconfigs templates buildlogs resourcequotausages |
impersonate |
|
list |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy bindings events limitranges
namespaces namespaces/status pods/log pods/status replicationcontrollers/status
resourcequotas resourcequotas/status horizontalpodautoscalers cronjobs jobs
scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale daemonsets statefulsets buildconfigs
buildconfigs/webhooks builds builds/log deploymentconfigs
deploymentconfigs/scale generatedeploymentconfigs deploymentconfigs/log
deploymentconfigs/status imagestreamimages imagestreammappings imagestreams
imagestreams/secrets imagestreamtags imagestreams/status
appliedclusterresourcequotas routes routes/status processedtemplates
templateconfigs templates buildlogs resourcequotausages |
patch |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy horizontalpodautoscalers
cronjobs jobs scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale statefulsets buildconfigs buildconfigs/webhooks
builds deploymentconfigs deploymentconfigs/scale generatedeploymentconfigs
imagestreamimages imagestreammappings imagestreams imagestreams/secrets
imagestreamtags routes processedtemplates templateconfigs templates buildlogs |
proxy |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy |
update |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy horizontalpodautoscalers
cronjobs jobs scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale statefulsets buildconfigs buildconfigs/webhooks
builds deploymentconfigs deploymentconfigs/scale generatedeploymentconfigs
imagestreamimages imagestreammappings imagestreams imagestreams/secrets
imagestreamtags imagestreams/layers routes processedtemplates templateconfigs
templates buildlogs |
watch |
pods pods/attach pods/exec pods/portforward pods/proxy configmaps endpoints
persistentvolumeclaims replicationcontrollers replicationcontrollers/scale
secrets serviceaccounts services services/proxy bindings events limitranges
namespaces namespaces/status pods/log pods/status replicationcontrollers/status
resourcequotas resourcequotas/status horizontalpodautoscalers cronjobs jobs
scheduledjobs deployments deployments/rollback deployments/scale
horizontalpodautoscalers jobs replicasets replicasets/scale
replicationcontrollers/scale daemonsets statefulsets buildconfigs
buildconfigs/webhooks builds builds/log deploymentconfigs
deploymentconfigs/scale generatedeploymentconfigs deploymentconfigs/log
deploymentconfigs/status imagestreamimages imagestreammappings imagestreams
imagestreams/secrets imagestreamtags imagestreams/status
appliedclusterresourcequotas routes routes/status processedtemplates
templateconfigs templates buildlogs resourcequotausages |
Table 6. self-provisioner Rules Matrix
create |
|
Table 7. view Rules Matrix
get |
configmaps endpoints persistentvolumeclaims pods replicationcontrollers
serviceaccounts services bindings events limitranges namespaces
namespaces/status pods/log pods/status replicationcontrollers/status
resourcequotas resourcequotas/status horizontalpodautoscalers cronjobs jobs
scheduledjobs deployments deployments/scale horizontalpodautoscalers jobs
replicasets replicasets/scale daemonsets statefulsets buildconfigs
buildconfigs/webhooks builds builds/log deploymentconfigs
deploymentconfigs/scale deploymentconfigs/log deploymentconfigs/status
imagestreamimages imagestreammappings imagestreams imagestreamtags
imagestreams/status projects appliedclusterresourcequotas routes routes/status
processedtemplates templateconfigs templates buildlogs resourcequotausages |
list |
configmaps endpoints persistentvolumeclaims pods replicationcontrollers
serviceaccounts services bindings events limitranges namespaces
namespaces/status pods/log pods/status replicationcontrollers/status
resourcequotas resourcequotas/status horizontalpodautoscalers cronjobs jobs
scheduledjobs deployments deployments/scale horizontalpodautoscalers jobs
replicasets replicasets/scale daemonsets statefulsets buildconfigs
buildconfigs/webhooks builds builds/log deploymentconfigs
deploymentconfigs/scale deploymentconfigs/log deploymentconfigs/status
imagestreamimages imagestreammappings imagestreams imagestreamtags
imagestreams/status appliedclusterresourcequotas routes routes/status
processedtemplates templateconfigs templates buildlogs resourcequotausages |
watch |
configmaps endpoints persistentvolumeclaims pods replicationcontrollers
serviceaccounts services bindings events limitranges namespaces
namespaces/status pods/log pods/status replicationcontrollers/status
resourcequotas resourcequotas/status horizontalpodautoscalers cronjobs jobs
scheduledjobs deployments deployments/scale horizontalpodautoscalers jobs
replicasets replicasets/scale daemonsets statefulsets buildconfigs
buildconfigs/webhooks builds builds/log deploymentconfigs
deploymentconfigs/scale deploymentconfigs/log deploymentconfigs/status
imagestreamimages imagestreammappings imagestreams imagestreamtags
imagestreams/status appliedclusterresourcequotas routes routes/status
processedtemplates templateconfigs templates buildlogs resourcequotausages |
By default in a local policy, only the binding for the admin role is
immediately listed when using the CLI to
view
local bindings.
However, if other default roles are added to users and groups within a local
policy, they become listed in the CLI output, as well.
If you find that these roles do not suit you, a cluster-admin user can create
a policyBinding
object named <projectname>:default
with the CLI using a
JSON file. This allows the project admin to bind users to roles that are
defined only in the <projectname>
local policy.
|
The cluster- role assigned by the project administrator is limited in a
project. It is not the same cluster- role granted by the cluster-admin or
system:admin.
Cluster roles are roles defined at the cluster level, but can be bound either at
the cluster level or at the project level.
|
Updating Cluster Roles
$ oc adm policy reconcile-cluster-roles