Interview Prep/Kubernetes/Rapid-Fire Commands

How do you extract and verify RBAC for a ServiceAccount and find who can do what?

AdvancedProductionRapid-Fire Commands
Answer
kubectl get rolebinding,clusterrolebinding -A -o json | jq -r '.items[] | select(.subjects[]? | .kind=="ServiceAccount" and .name=="ci") | .metadata.namespace+"/"+.metadata.name+" -> "+.roleRef.name'
kubectl auth can-i --list --as=system:serviceaccount:shop:ci -n shop
kubectl who-can delete secrets -n shop     # krew plugin
All Kubernetes questions

More on Rapid-Fire Commands