Courseiva
Application Environment, Configuration and SecuritymediumMultiple ChoiceObjective-mapped

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

    Incorrect. For pods, the apiGroup is core (empty string). Omitting apiGroup is allowed and defaults to core.

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

    Why it's wrong here

    Incorrect. The Role includes 'list', so that is not the issue.

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

    Why this is correct

    Correct. Role and RoleBinding are scoped to a single namespace. To grant access across namespaces, you need ClusterRole and ClusterRoleBinding.

  • The RoleBinding is not bound to the correct ServiceAccount

    Why it's wrong here

    Incorrect. The RoleBinding binds to 'sa1', which is the correct ServiceAccount.

About these practice questions

One of 160 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.