The RBAC (Role-Based Access Control) section helps you understand and manage access control in your Kubernetes cluster.
Overview
Kubernetes RBAC controls who can do what in your cluster:- Roles - Namespace-scoped permissions
- ClusterRoles - Cluster-wide permissions
- RoleBindings - Grant Roles to users/groups in a namespace
- ClusterRoleBindings - Grant ClusterRoles cluster-wide
- ServiceAccounts - Identities for pods and services
Accessing RBAC Resources
Navigate to your cluster and click Kubernetes in the sidebar. RBAC resources include:Roles and ClusterRoles
Roles define what actions are allowed on which resources.Roles (Namespace-scoped)
Roles grant permissions within a specific namespace.ClusterRoles (Cluster-wide)
ClusterRoles grant permissions across all namespaces or on cluster-scoped resources.Rule Details
Click a Role or ClusterRole to view its rules:Common Verbs
Built-in ClusterRoles
RoleBindings and ClusterRoleBindings
Bindings connect Roles to users, groups, or service accounts.RoleBindings (Namespace-scoped)
Grant a Role’s permissions within a specific namespace.ClusterRoleBindings (Cluster-wide)
Grant a ClusterRole’s permissions across all namespaces.Subject Types
Binding Details
Click a binding to view:- Role Reference - The Role or ClusterRole being granted
- Subjects - Who receives the permissions
ServiceAccounts
ServiceAccounts provide identities for pods and applications.Viewing ServiceAccounts
ServiceAccount Details
Click a ServiceAccount to view:- Secrets - Associated token secrets
- Image Pull Secrets - Registry credentials
- Automount Token - Whether token is auto-mounted to pods
- Used By - Pods using this service account
Default ServiceAccount
Every namespace has adefault ServiceAccount. Pods use it unless another is specified:
Common Patterns
Viewing Who Has Access
- Navigate to ClusterRoleBindings or RoleBindings
- Search for bindings referencing a specific role
- View the Subjects to see who has that role
Checking a ServiceAccount’s Permissions
- Find the ServiceAccount in Service Accounts
- Navigate to RoleBindings and ClusterRoleBindings
- Filter for bindings where the subject is this ServiceAccount
- View the referenced Roles to see granted permissions
Least Privilege Principle
When creating new roles:- Start with minimal permissions
- Add specific verbs and resources as needed
- Use Roles instead of ClusterRoles when possible
- Avoid wildcard (
*) permissions in production
RBAC Examples
Read-only Access to Pods
Deployment Manager
Binding to a ServiceAccount
Troubleshooting RBAC
”Forbidden” Errors
When you seeError from server (Forbidden):
- Check which user/ServiceAccount is making the request
- Find bindings for that subject
- Verify the Role includes the necessary verb and resource
- Check the correct namespace for RoleBindings
Debugging Steps
-
Check the user/SA:
- What identity is making the request?
-
Find bindings:
- Search RoleBindings/ClusterRoleBindings for the subject
-
Check the Role:
- Verify rules include the required verb + resource
-
Namespace scope:
- Is it a namespaced resource? Is the RoleBinding in the right namespace?
Tips
Still have questions? Join our Slack community and we’ll help out.