Interview Prep/Kubernetes/Security, RBAC and policy

Explain the difference between Role, ClusterRole, RoleBinding and ClusterRoleBinding.

IntermediateScenarioSecurity, RBAC and policy
Answer

Situation read → An audit finds a ClusterRoleBinding where a RoleBinding was intended.

What I'd do →

  1. Role grants permissions inside a namespace
  2. ClusterRole grants cluster-wide or can be reused across namespaces
  3. RoleBinding grants a Role or ClusterRole within one namespace
  4. ClusterRoleBinding grants cluster-wide
  5. Audit with kubectl get clusterrolebindings -o wide and kubectl who-can/rbac-tool

Why → Binding scope decides how far the permissions reach, not the role kind.

Interview tip → Mention aggregated ClusterRoles.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Security, RBAC and policy