Kubernetes ClusterRole is a cluster-wide Role-Based Access Control, or RBAC, object that defines what actions are allowed against Kubernetes resources. It can describe permissions for cluster-scoped resources like Nodes and PersistentVolumes, and it can also define reusable permissions for namespaced resources like Pods, Deployments, and Services.
A ClusterRole defines a set of permissions. It does not grant those permissions by itself. Kubernetes grants the permissions only when you attach the ClusterRole to a user, group, or ServiceAccount using a binding.
Common permissions include:
get, list, and watch on Pods or Nodes.create, update, patch, and delete on Deployments or ConfigMaps./healthz or /metrics.A ClusterRole contains RBAC rules. Each rule usually includes:
apps, batch, or an empty string for core resources like Pods and Services.pods, deployments, or nodes.get, list, watch, create, or delete.Example ClusterRole:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: pod-reader
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch"]
This object defines read-only access to Pods across the cluster, but nobody receives that access until it is bound.
You grant a ClusterRole with either a ClusterRoleBinding or a RoleBinding:
For example, you can create one ClusterRole named pod-reader and bind it with RoleBindings in dev, staging, and prod. This keeps the permission definition consistent while limiting where each team can use it.
A Role belongs to one namespace and can grant access only within that namespace. A ClusterRole is cluster-scoped and can grant access to cluster-level resources, or serve as a reusable permission template for multiple namespaces.
Use a Role when the permission is specific to one namespace. Use a ClusterRole when you need access to cluster-scoped resources, or when you want one shared permission definition across many namespaces.
A startup runs several teams on one Kubernetes cluster. The platform team wants developers to inspect Pods, logs, and Deployments in their own namespaces, but not edit cluster-wide objects like Nodes or ClusterRoles.
The platform team can create a ClusterRole with read-only access to common workload resources. Then it can create RoleBindings in each team namespace. Developers get consistent read access where they need it, while cluster administration remains restricted.
The same pattern applies when managing Kubernetes resources through infrastructure workflows, such as deploying Kubernetes resources using Terraform, where RBAC objects should be reviewed and version-controlled like other production configuration.
* or resources like * can give much broader access than intended.Many Kubernetes controllers need ClusterRoles because they watch resources across namespaces or manage cluster-scoped objects. For example, a controller that provisions cloud infrastructure through Kubernetes may need access to CustomResourceDefinitions, provider-specific custom resources, Secrets, and events.
This is common in workflows such as deploying AWS resources using Crossplane on Kubernetes, where the controller needs enough RBAC access to reconcile infrastructure definitions safely.
cluster-admin for applications, CI jobs, and controllers unless there is a clear, temporary reason.kubectl auth can-i before rolling them out to production.A Kubernetes ClusterRole is a core RBAC building block. Used carefully, it gives teams consistent, auditable access control across the cluster without giving every user or workload broad administrative permissions.