A ClusterRole defines RBAC permissions for cluster-scoped resources, such as nodes, persistent volumes, and namespaces. Unlike a Role, it is not confined to one namespace. Its rules specify resources and permitted verbs, such as get, list, create, or delete; a binding grants those rules to a user, group, or ServiceAccount. section 3.1.1 section 9.3.2
Choose the binding to match the intended reach:
- Use a ClusterRoleBinding to grant a ClusterRole's permissions cluster-wide. section 3.1.1
- Use a RoleBinding to grant permissions from a ClusterRole within one namespace. A ClusterRoleBinding cannot reference a Role. section 3.1.1 section 3.3
Check an existing grant
Run `kubectl get clusterrole` to find available ClusterRoles. The built-in `cluster-admin`, `admin`, `edit`, and `view` roles offer different levels of access; do not assume that `view` includes Secrets or that `edit` permits changing roles. After binding a role, check a particular subject and action with `kubectl auth can-i`, for example `kubectl auth can-i get pods -n default --as carol`. section 3.1.2 section 3.1.1
kubectl get clusterrolebinding kubeadm:cluster-admins -o yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: creationTimestamp: "2025-09-02T19:09:30Z" name: kubeadm:cluster-admins resourceVersion: "241" uid: 4b7e6cba-c951-431e-af88-32958326de97 roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - apiGroup: rbac.authorization.k8s.io kind: Group name: kubeadm:cluster-admins
Inspect the ClusterRoleBinding YAML: `roleRef` names the `cluster-admin` ClusterRole, while `subjects` identifies the group receiving it. section 3.1.2
For practice, define a ClusterRole allowing `create` on Deployments, ReplicaSets, and DaemonSets, then bind it to a ServiceAccount only in the default namespace. Verify with `kubectl auth can-i` that the ServiceAccount cannot create Deployments in `kube-system`. The check catches a binding whose reach is broader than intended. section 3.3


