Key Differences
RoleNamespaced. Grants permissions within one namespace only.
ClusterRoleCluster-wide. Works across all namespaces and for non-namespaced resources.
RoleBindingBinds Role or ClusterRole to subjects within a namespace.
ClusterRoleBindingBinds ClusterRole to subjects cluster-wide.
Common Verbs
getRead a single specific resource by name.
listList all resources of a type.
watchStream changes to resources in real time.
createCreate a new resource.
updateModify an existing resource.
deleteRemove a resource.
*Wildcard all verbs. Use with caution.
kubectl Commands
get rolesList all roles in current namespace.
get clusterrolesList all cluster roles.
describe role <name>Show what a role can do.
auth can-i <verb> <resource>Test your own permissions.
auth can-i <verb> <resource> --as <user>Test another user's permissions.
Subject Types
UserA human user authenticated to the cluster.
GroupA group of users. system:masters gives cluster admin.
ServiceAccountAn identity for a pod or process running inside the cluster.