Granting user access to extension resources by using aggregated cluster roles
As a cluster administrator, you can configure role-based access control (RBAC) policies to grant user access to extension resources by using aggregated cluster roles.
|
|
To automatically extend existing default cluster roles, you can add aggregation labels by adding one or more of the following labels to a
This allows users who already have |
-
A cluster extension has been installed on your cluster.
-
You have a list of API groups and resource names, as described in "Finding API groups and resources exposed by a cluster extension".
-
Create an object definition for a cluster role that specifies the API groups and resources provided by the cluster extension and add an aggregation label to extend one or more existing default cluster roles:
ExampleClusterRoleobject with an aggregation labelapiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: view-custom-resource-aggregated labels: rbac.authorization.k8s.io/aggregate-to-view: "true" rules: - apiGroups: - <cluster_extension_api_group> resources: - <cluster_extension_custom_resource> verbs: - get - list - watchYou can create similar
ClusterRoleobjects foreditandadminwith appropriate verbs, such ascreate,update, anddelete. By using aggregation labels, the permissions for the custom resources are added to the default roles. -
Save your object definition to a YAML file.
-
Create the object by running the following command:
$ oc create -f <filename>.yaml