FahamLah

Commands

kubectl auth can-i

kubectl auth can-i <verb> <resource> [-n ns] [--as=user|system:serviceaccount:ns:name]

Risk: Safe

What it does

Asks RBAC: may this user do this? Answers yes or no.

When to use it

To check a bot has only the rights it needs.

Example

$ kubectl auth can-i delete pods --as=system:serviceaccount:default:ci-bot

May the CI bot delete pods?