Bird
0
0

You applied this RoleBinding YAML but the user still cannot access resources:

medium📝 Troubleshoot Q6 of 15
Kubernetes - RBAC and Security
You applied this RoleBinding YAML but the user still cannot access resources:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: access-pods
  namespace: test
subjects:
- kind: User
  name: bob
roleRef:
  kind: Role
  name: pod-reader
  apiGroup: rbac.authorization.k8s.io
What is the most likely issue?
ANamespace field is missing in subjects
BThe user 'bob' is misspelled
CRoleBinding must use ClusterRole instead of Role
DThe Role 'pod-reader' does not exist in the 'test' namespace
Step-by-Step Solution
Solution:
  1. Step 1: Verify Role existence in namespace

    The RoleBinding references a Role named 'pod-reader' in 'test' namespace; if it doesn't exist, permissions won't apply.
  2. Step 2: Check other fields

    User name and namespace fields are correct; RoleBinding uses Role correctly for namespace scope.
  3. Final Answer:

    The Role 'pod-reader' does not exist in the 'test' namespace -> Option D
  4. Quick Check:

    Role must exist in RoleBinding's namespace [OK]
Quick Trick: RoleBinding requires referenced Role to exist in same namespace [OK]
Common Mistakes:
  • Assuming RoleBinding works without existing Role
  • Confusing RoleBinding with ClusterRoleBinding requirements
  • Ignoring namespace scope of Role

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes