CK.IV · CKAD practice question
How do you test whether ServiceAccount deploy-sa in namespace staging is permitted to create deployments in namespace staging?
Check answer and explanation
Correct answer: kubectl auth can-i create deployments -n staging --as=system:serviceaccount:staging:deploy-sa
Explanation
kubectl auth can-i -n --as=system:serviceaccount:: evaluates RBAC authorization as that ServiceAccount.
Common trap
kubectl auth can-i -n --as=system:serviceaccount:: evaluates RBAC authorization as that ServiceAccount.
Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.