Courseiva

RBAC Namespace Scope: Role and RoleBinding Limitations

A developer created a Role named 'pod-reader' in namespace 'ns1' that allows 'get', 'list', and 'watch' on pods. They created a RoleBinding binding this Role to a ServiceAccount 'sa1' in the same namespace. However, a pod using 'sa1' cannot list pods in namespace 'ns2'. What is the most likely cause?

Quick Answer

The answer is that Role and RoleBinding are namespace-scoped resources, so they cannot grant permissions across namespaces. This is because a Role defined in 'ns1' only applies to resources within 'ns1', and a RoleBinding in the same namespace binds that Role to a ServiceAccount exclusively for operations inside that namespace. To list pods in 'ns2', the ServiceAccount requires a separate Role and RoleBinding (or a ClusterRole and ClusterRoleBinding) that explicitly grant permissions in 'ns2'. On the CKAD exam, this tests your understanding of Kubernetes RBAC namespace scope and the critical distinction between namespace-scoped and cluster-scoped resources. A common trap is assuming a RoleBinding can reach across namespaces, but the core limitation is that both the Role and RoleBinding are confined to their namespace. Remember the mnemonic: "Role and RoleBinding stay in their own namespace—no cross-namespace magic."

⚠ Common exam trap

The trap here is that candidates often overlook the namespace-scoped nature of Role and RoleBinding, assuming that a RoleBinding can grant permissions across namespaces, when in fact it is strictly confined to the namespace of the RoleBinding itself.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Role and RoleBinding are namespace-scoped; they only grant permissions within their namespace

Role and RoleBinding are namespace-scoped resources in Kubernetes. A Role defined in 'ns1' grants permissions only within 'ns1', and a RoleBinding in 'ns1' binds that Role to a ServiceAccount only for operations inside 'ns1'. To list pods in 'ns2', the ServiceAccount needs a separate Role and RoleBinding (or a ClusterRole and ClusterRoleBinding) that explicitly grant permissions in 'ns2'. Therefore, the pod using 'sa1' cannot list pods in 'ns2' because the Role and RoleBinding are confined to 'ns1'.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The Role is missing the apiGroup field

    Why it's wrong here

    A Role's rules are namespaced: a RoleBinding only grants access within its own namespace, so sa1 can never list pods in ns2 regardless of apiGroup. The apiGroup field is required in rules, but its absence would break even ns1 access. ClusterRole with ClusterRoleBinding is the correct construct for cross-namespace permissions.

  • ✗

    The Role does not include the 'list' verb for pods

    Why it's wrong here

    The Role explicitly includes get, list and watch on pods, so the verb is present; the real cause is namespace scoping, since Role and RoleBinding only apply within ns1. It is tempting because missing verbs commonly break access, but that is not the case here.

  • ✓

    Role and RoleBinding are namespace-scoped; they only grant permissions within their namespace

    Why this is correct

    Role and RoleBinding are namespaced resources, so the permissions they grant apply only within ns1. Listing pods in ns2 requires a separate Role and RoleBinding in that namespace, or a ClusterRole paired with a ClusterRoleBinding for cluster-wide access. The stem's cross-namespace failure confirms this scoping constraint.

  • ✗

    The RoleBinding is not bound to the correct ServiceAccount

    Why it's wrong here

    The RoleBinding correctly references sa1 in ns1; the failure stems from Role and RoleBinding being namespace-scoped, so they grant permissions only within ns1. It is tempting because binding mistakes cause similar symptoms, but here the binding is correct and a ClusterRole with ClusterRoleBinding is required for ns2.

About these practice questions

One of 826 original CKAD practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on CKAD

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A ClusterRole named 'pod-reader' allows get, list, and watch on pods. A RoleBinding 'read-pods' in namespace 'default' binds this ClusterRole to user 'jane'. Which statement is true?

medium
  • A.User 'jane' can read pods in all namespaces because ClusterRole is cluster-scoped
  • B.The RoleBinding must be changed to a ClusterRoleBinding for it to work
  • C.User 'jane' can read pods and also delete them because ClusterRole gives full access
  • ✓ D.User 'jane' can read pods only in the 'default' namespace

Why D: A RoleBinding in a specific namespace binds a ClusterRole to a subject only within that namespace. Since the RoleBinding 'read-pods' is in the 'default' namespace, user 'jane' receives the permissions defined in the 'pod-reader' ClusterRole (get, list, watch on pods) only within the 'default' namespace, not across all namespaces.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CKAD practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKAD exam.