Kubernetes RBAC, or Role-Based Access Control, is the Kubernetes authorization model that controls which users, groups, and service accounts can perform actions on cluster resources. It answers questions like “Can this service account list pods in this namespace?” or “Can this engineer delete deployments in production?”
Kubernetes RBAC limits access to the Kubernetes API. Every action in Kubernetes, such as creating a pod, reading a secret, updating a deployment, or deleting a namespace, goes through the API server. RBAC decides whether the authenticated identity has permission to make that request.
Teams use RBAC to reduce risk in shared clusters. For example, a CI/CD service account might be allowed to update deployments in the staging namespace, while only senior platform engineers can modify cluster-wide networking resources.
RBAC uses a few core Kubernetes objects:
Permissions are written as rules. A rule usually includes:
apps, batch, or the core API group.pods, deployments, secrets, or jobs.get, list, watch, create, update, patch, and delete.For example, a Role can allow a service account to get, list, and watch pods in the dev namespace, without allowing it to delete pods or read secrets.
Kubernetes RBAC handles authorization, not authentication. Authentication confirms who is making the request. Authorization decides what that identity can do.
In a managed Kubernetes cluster, authentication may come from a cloud identity system, client certificates, OIDC, or another identity provider. After Kubernetes identifies the caller, RBAC checks the matching Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings.
payments, analytics, or frontend.Assume your startup runs a shared Kubernetes cluster with separate namespaces for dev, staging, and prod. You want the backend team to manage workloads in staging, but you do not want them to delete production resources or read production secrets.
You could create a Role in the staging namespace that allows updates to Deployments, Services, ConfigMaps, and Jobs. Then you bind that Role to the backend team’s group. The same group gets no RoleBinding in prod, or gets a read-only Role there.
This setup gives developers enough access to ship and debug staging services, while reducing the chance of accidental production changes.
Service accounts are one of the most common RBAC subjects. Pods use service accounts when they talk to the Kubernetes API. Controllers, deployment tools, monitoring agents, and operators often need service accounts with specific permissions.
For example, a deployment automation tool may need permission to patch Deployments, create Jobs, and read rollout status. It probably does not need permission to read every Secret in the cluster. Keeping those permissions narrow reduces blast radius if a token leaks.
Many teams manage RBAC manifests through GitOps or infrastructure as code. Terraform, Helm, Kustomize, Argo CD, Flux, and similar tools can apply Roles and RoleBindings consistently across environments.
If you manage Kubernetes objects with Terraform, RBAC should be part of the same review process as namespaces, deployments, and service accounts. This keeps access changes visible in pull requests. For a related workflow, see this guide on how to deploy Kubernetes resources using Terraform.
RBAC also matters when Kubernetes controllers create or manage cloud resources. Tools such as Crossplane often need carefully scoped permissions inside the cluster, along with cloud-side IAM permissions. This matters when you deploy AWS resources using Crossplane on Kubernetes.
cluster-admin to users or service accounts gives full control over the cluster.cluster-admin: Reserve it for a small set of break-glass or platform administration identities.kubectl auth can-i: Test effective permissions before and after changes.You can inspect RBAC behavior with commands such as:
kubectl auth can-i create deployments -n stagingkubectl auth can-i get secrets -n prodkubectl auth can-i list pods --as system:serviceaccount:staging:deploy-bot -n stagingkubectl get rolebindings -n stagingkubectl get clusterrolebindingsThese checks are useful when debugging failed deployments, locked-down service accounts, or permission errors from controllers.
Kubernetes RBAC is the built-in way to control access to the Kubernetes API. It maps users, groups, and service accounts to allowed actions on resources. Good RBAC design helps teams ship safely in shared clusters, protects sensitive resources, and keeps automation scoped to the permissions it needs.