kubectl auth whoami
The kubectl command that asks the API server which user name and groups it believes your credentials belong to.
In more detail
It answers the authentication question directly, which is the first thing to check when a request is forbidden. The answer comes from the server, so it reflects your real identity rather than the name in your kubeconfig.
Example
kubectl auth whoamiRelated terms
- authentication — Establishing who a request represents, for example by checking a password, a session cookie or a signed token.
- 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.
Taught in
- Authentication, Authorisation And Admission — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Control Plane: etcd, API Server, Scheduler, Controllers — Kubernetes: Production-Grade Container Orchestration