Your requests get `error: You must be logged in to the server (Unauthorized)` on a kubeadm cluster that worked yesterday.
IntermediateTroubleshootingControl plane, RBAC, webhooks and autoscaling
Answer
Likely causes → HTTP 401: the credential is invalid. The client certificate in your kubeconfig expired (kubeadm admin certs last 1 year), an OIDC token expired and refresh failed, or the cluster CA changed.
Diagnose →
kubectl config view --raw -o jsonpath='{.users[0].user.client-certificate-data}' | base64 -d | openssl x509 -noout -enddate
kubectl config view --minify | grep -E 'server|user'
Fix → Regenerate credentials: kubeadm kubeconfig user --client-name=jane or copy the renewed /etc/kubernetes/admin.conf after kubeadm certs renew. For OIDC, re-login with your plugin (kubectl oidc-login).
Prevent → Short-lived OIDC credentials for humans instead of long-lived certs; certificate expiry alerts.
More on Control plane, RBAC, webhooks and autoscaling
A developer gets `Error from server (Forbidden): pods is forbidden: User "[email protected]" cannot list resource "pods" in API group "" in the namespace "payments"`.BeginnerA CI pipeline fails with `deployments.apps "api" is forbidden: User "system:serviceaccount:ci:deployer" cannot patch resource "deployments" in API group "apps" in the namespace "prod"`.BeginnerA user can `get pods` but `kubectl logs` fails with `cannot get resource "pods/log"` and `kubectl exec` fails with `cannot create resource "pods/exec"`.BeginnerCreating a RoleBinding fails with `is attempting to grant RBAC permissions not currently held`.IntermediateEvery `kubectl apply` fails with `Internal error occurred: failed calling webhook "validate.kyverno.svc-fail": failed to call webhook: Post "https://kyverno-svc.kyverno.svc:443/validate/fail?timeout=10s": context deadline exceeded`.AdvancedCreating a Certificate fails with `failed calling webhook "webhook.cert-manager.io": ... no endpoints available for service "cert-manager-webhook"`.Intermediate