concept

RBAC roles and bindings

Read Kubernetes RBAC rules, trace RoleBindings and restrict access by API group, verb, resource and namespace. Role-based access control (RBAC) describes permissions separately from identities.

Formal Syntax & Structure

kubernetes syntaxkubernetes
apiGroups / resources / verbs / resourceNames

Working Example

Example Snippetkubernetes
apiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata:  name: catalog-pod-reader  namespace: book-labrules:- apiGroups: [""]  resources: [pods]  verbs: [get, list, watch]---apiVersion: rbac.authorization.k8s.io/v1kind: RoleBindingmetadata:  name: catalog-pod-reader  namespace: book-labsubjects:- kind: ServiceAccount  name: catalog-reader  namespace: book-labroleRef:  apiGroup: rbac.authorization.k8s.io  kind: Role  name: catalog-pod-reader
Kubernetes Reference