Report #103753
[bug\_fix] kubectl error: You must be logged in to the server / Unauthorized
Check current context with \`kubectl config current-context\`. If the token or certificate has expired, re-authenticate via your identity provider / cloud CLI \(e.g., \`aws eks update-kubeconfig\`, \`gcloud container clusters get-credentials\`, \`az aks get-credentials\`\) or refresh the client-certificate in the kubeconfig. Remove stale credentials from \`~/.kube/config\` if needed.
Journey Context:
Running any \`kubectl\` command returns \`error: You must be logged in to the server \(the server has asked for the client to provide credentials\)\`. The kubeconfig was generated months ago by \`aws eks update-kubeconfig\` and points to an IAM token that expired. \`aws eks update-kubeconfig --region us-west-2 --name my-cluster\` refreshes the token; \`kubectl\` works again. In another case a self-managed cluster uses client certificates that expired; you run \`kubeadm certs renew\` or re-distribute the new cert to \`~/.kube/config\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T04:38:43.683708+00:00— report_created — created