Key Concepts
RoleBinding
Role Reference
Subjects
System Binding
system: or kubeadm:).Required Permissions
Binding Types
Subject Types
How to View RoleBindings
Select Cluster
Select Namespace
Filter and Search
How to View RoleBinding Details
Find the RoleBinding
Click Binding Name
Review Details
- Overview: Name, namespace, type (system/custom), age
- Role Reference: The Role or ClusterRole being bound (kind and name)
- Subjects: List of users, groups, and service accounts
- Labels & Annotations: Metadata attached to the binding
How to Create a RoleBinding
Click Create Binding
Write YAML
metadata.namespace- Target namespaceroleRef- Reference to the Role or ClusterRole to bindsubjects- List of users, groups, or service accounts
Create
How to Edit a RoleBinding
Open Actions Menu
Click Edit YAML
Modify Subjects
Save
How to Delete a RoleBinding
Open Actions Menu
Click Delete
Confirm
Example RoleBindings
Bind Role to User
Bind ClusterRole to Namespace
Grant Permissions to ServiceAccount
Multiple Subjects
Subject Reference Format
RoleBinding vs ClusterRoleBinding
Troubleshooting
User cannot access namespace resources
User cannot access namespace resources
- Verify a RoleBinding exists in the correct namespace
- Check the subject name matches exactly (case-sensitive)
- Verify the referenced Role or ClusterRole has the needed permissions
- Use
kubectl auth can-i --as=<user> -n <namespace>to test permissions - Check for typos in user/group names
ServiceAccount permissions not working
ServiceAccount permissions not working
- Verify the namespace is specified in the subject
- Check the ServiceAccount exists in that namespace
- Ensure pods are using the correct ServiceAccount
- Verify the RoleBinding is in the same namespace as the pod
Cannot delete RoleBinding
Cannot delete RoleBinding
- System bindings cannot be deleted
- Verify you have delete permission
- Check for finalizers blocking deletion
Changes not taking effect
Changes not taking effect
- RBAC changes are immediate
- Clear any client-side caching
- Verify the binding was actually updated
- Check if there are conflicting bindings
Cannot change roleRef
Cannot change roleRef
- roleRef is immutable after creation
- Delete the binding and create a new one
- This is by design to prevent privilege escalation
ClusterRole permissions not working in namespace
ClusterRole permissions not working in namespace
- Verify the RoleBinding references the ClusterRole correctly
- Check the RoleBinding is in the target namespace
- Ensure the ClusterRole has the necessary rules
- ClusterRole permissions are limited to the RoleBinding’s namespace
FAQ
What is the difference between RoleBinding and ClusterRoleBinding?
What is the difference between RoleBinding and ClusterRoleBinding?
Can a RoleBinding reference a ClusterRole?
Can a RoleBinding reference a ClusterRole?
Why can't I change the roleRef?
Why can't I change the roleRef?
roleRef is immutable to prevent privilege escalation. If you could change it, you could escalate permissions without delete access. To change the role, delete and recreate the binding.How do I grant the same permissions in multiple namespaces?
How do I grant the same permissions in multiple namespaces?
- Create separate RoleBindings in each namespace referencing the same Role (requires Role in each namespace)
- Create a ClusterRole and bind it with RoleBindings in each namespace (recommended)
Can multiple bindings reference the same role?
Can multiple bindings reference the same role?
What happens when I delete a user's binding?
What happens when I delete a user's binding?
Can a ServiceAccount from another namespace be a subject?
Can a ServiceAccount from another namespace be a subject?
What happens if the referenced Role doesn't exist?
What happens if the referenced Role doesn't exist?