Every `kubectl` command on a kubeadm cluster fails with `Unable to connect to the server: x509: certificate has expired or is not yet valid: current time 2026-03-14T09:12:44Z is after 2026-03-13T08:01:10Z`.
AdvancedTroubleshootingCluster operations: certs, drains, rollouts and quotas
Answer
Likely causes → The kubeadm-generated certificates (API server, front-proxy, etcd clients, admin.conf) expired after one year because the cluster was never upgraded (kubeadm renews certs on kubeadm upgrade apply) and nobody renewed them.
Diagnose →
sudo kubeadm certs check-expiration
sudo openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -enddate
Fix → On each control-plane node:
sudo kubeadm certs renew all
# Restart static Pods so they load new certs
sudo mkdir -p /tmp/manifests && sudo mv /etc/kubernetes/manifests/*.yaml /tmp/manifests/
sleep 20 && sudo mv /tmp/manifests/*.yaml /etc/kubernetes/manifests/
sudo cp /etc/kubernetes/admin.conf ~/.kube/config
Check that kubelet client certs are rotating (/var/lib/kubelet/pki/kubelet-client-current.pem) and redistribute any kubeconfigs built from the old admin cert.
Prevent → Upgrade at least yearly, alert on certificate expiry (30 days), and keep the renewal runbook tested.
More on Cluster operations: certs, drains, rollouts and quotas
`kubectl drain` loops on `error when evicting pods/"web-6d8f-k2x9q" -n "prod" (will retry after 5s): Cannot evict pod as it would violate the pod's disruption budget.`Intermediate`kubectl drain` stops with `cannot delete DaemonSet-managed Pods (use --ignore-daemonsets to ignore)` and `cannot delete Pods with local storage (use --delete-emptydir-data to override)`.BeginnerThe CD pipeline fails with `error: deployment "api" exceeded its progress deadline` from `kubectl rollout status`.IntermediateA rollout is stuck at 1 new Pod Pending, and with `maxUnavailable: 0` no old Pod is removed.IntermediatePods are not created and the ReplicaSet events show `Error creating: pods "web-5f9c-" is forbidden: exceeded quota: compute-quota, requested: requests.cpu=500m, used: requests.cpu=3800m, limited: requests.cpu=4`.BeginnerPod creation fails with `failed quota: compute-quota: must specify limits.cpu for: app; requests.memory for: app`.Beginner