fINTERACTIVE FIELD GUIDES
People and clusters05 / 30

ClusterRole

A reusable set of Kubernetes API permissions that bindings can grant to callers.

Learning status: Not practiced

A ClusterRole defines operations on the Kubernetes API. For example, a role called pod-reader could contain this rule:

rules:
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["get", "list", "watch"]

The empty API group identifies the core Kubernetes API. These verbs let a caller read pods, list them, and watch for changes. The rule grants no permission to change a pod or read its logs, which use the separate pods/log subresource.

A ClusterRole has no namespace. To give a team these permissions in the orders namespace, reference the role from a RoleBinding there. A ClusterRoleBinding grants the same permissions across namespaces.

Source: Kubernetes RBAC reference.