Kubernetes
RBAC Commands
Secure your cluster with fine-grained access control. Learn Roles, ClusterRoles, RoleBindings, and how to implement least-privilege access for users and service accounts.
10 commands
Pro Tips
Use 'kubectl auth can-i' to check if a user/service account has specific permissions.
Create namespace-scoped Roles for most cases. Use ClusterRoles only when truly cluster-wide access is needed.
Use 'kubectl auth can-i --list' to see all permissions for the current user in current namespace.
Common Mistakes
Avoid using 'cluster-admin' ClusterRole except for break-glass scenarios. It grants full cluster access.
Service accounts inherit the 'default' SA permissions if not specified. Always create dedicated SAs.