Bird
0
0

Given this RoleBinding YAML snippet, what namespace will the binding apply to?

medium📝 Command Output Q13 of 15
Kubernetes - RBAC and Security
Given this RoleBinding YAML snippet, what namespace will the binding apply to?
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: read-pods
  namespace: dev
roleRef:
  kind: Role
  name: pod-reader
  apiGroup: rbac.authorization.k8s.io
subjects:
- kind: User
  name: jane
Adefault namespace
BCluster-wide
Ckube-system namespace
Ddev namespace
Step-by-Step Solution
Solution:
  1. Step 1: Check metadata namespace in RoleBinding

    The RoleBinding has namespace: dev in its metadata, so it applies in the 'dev' namespace.
  2. Step 2: Understand RoleBinding scope

    RoleBindings are namespace-scoped, so they only apply in the namespace where they are created.
  3. Final Answer:

    The RoleBinding applies to the dev namespace. -> Option D
  4. Quick Check:

    RoleBinding namespace = binding scope [OK]
Quick Trick: RoleBinding namespace field sets scope [OK]
Common Mistakes:
  • Assuming RoleBinding applies cluster-wide
  • Confusing RoleBinding with ClusterRoleBinding
  • Ignoring the metadata namespace field

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes