CKA Practice Question 1: RBAC ClusterRole Binding Scope
Certified Kubernetes Administrator (CKA) · Test 1 · question 1 of 10
You create a ClusterRole named pod-reader granting get, list, and watch on pods, then bind it to the user dev-user with a RoleBinding in the dev namespace. dev-user reports they can list pods in dev but get a Forbidden error in every other namespace.
You need dev-user to read pods in all namespaces, including namespaces created in the future, with the least additional configuration and without granting any other permission. What should you do?
Show answer and explanation
Answer:
A RoleBinding is a namespaced object. When a RoleBinding references a ClusterRole, it grants that ClusterRole's permissions only inside the RoleBinding's own namespace, which is exactly the behaviour observed. A ClusterRoleBinding grants the ClusterRole's rules across every namespace, including ones that do not exist yet, so option B is the minimal correct change.
Option A would technically work, but it is the opposite of minimal: it requires one Role and one RoleBinding per namespace and would need new objects every time a namespace is created; the stem rules this out.
Option C is not possible. namespace is part of a RoleBinding's identity as a namespaced resource; omitting it does not make the binding cluster-scoped, it just places the object in the default namespace (or whatever the current context is).
Option D grants the permissions, but cluster-admin allows every action on every resource. The stem requires granting no other permission, and this is a serious privilege escalation.
Reference: Using RBAC Authorization