kubectl auth can-i
The kubectl command that asks the authorizer whether an identity may perform one verb on one resource, answering yes or no.
In more detail
With --as you can check another identity, such as a service account, if you are allowed to impersonate it. It tests authorization only; it cannot predict a Pod Security Admission rejection. Test a nearby forbidden action as well, to prove the permission is narrow.
Examples
kubectl auth can-i get pods --as=webkubectl auth can-i get secrets --as=webRelated terms
- role-based access control — An authorization model where permissions are grouped into named roles, such as reader or editor, and people or services are given roles.
- authorization — Deciding whether an already identified caller may perform a particular action on a particular resource.
- kubectl auth whoami — The kubectl command that asks the API server which user name and groups it believes your credentials belong to.
Taught in
- ServiceAccounts And Tokens — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Authentication, Authorisation And Admission — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Configuration And Security: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Not The Admin Certificate: RBAC And ServiceAccounts — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Fundamentals Sprint: Four Tickets Before The Doors Open — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- The Festival, End To End: Final Review — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- RBAC: Roles, Bindings And Least Privilege — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: Forbidden Requests And Admission Rejections — Kubernetes: Production-Grade Container Orchestration