Bird
0
0

Given this RoleBinding YAML snippet, what does it do?

medium📝 Command Output Q13 of 15
Kubernetes - RBAC and Security
Given this RoleBinding YAML snippet, what does it do?
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: read-pods
subjects:
- kind: User
  name: alice
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: Role
  name: pod-reader
  apiGroup: rbac.authorization.k8s.io
ARevokes all permissions from user 'alice'
BGrants user 'alice' permission to create pods cluster-wide
CGrants user 'alice' permission to read pods in the namespace
DBinds user 'alice' to a ClusterRole named pod-reader
Step-by-Step Solution
Solution:
  1. Step 1: Analyze RoleBinding components

    The RoleBinding binds a Role named 'pod-reader' to user 'alice' in the current namespace.
  2. Step 2: Understand Role permissions

    The Role 'pod-reader' typically allows reading pods (get, watch, list) in the namespace.
  3. Final Answer:

    Grants user 'alice' permission to read pods in the namespace -> Option C
  4. Quick Check:

    RoleBinding + Role = namespace-scoped permission [OK]
Quick Trick: RoleBinding links Role permissions to a user in a namespace [OK]
Common Mistakes:
  • Confusing RoleBinding with ClusterRoleBinding
  • Assuming permissions are cluster-wide
  • Thinking it revokes permissions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes