Renew kubernetes pki after expired
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
When kubeadm-managed Kubernetes certificates expire, the control plane can stop functioning cleanly and kubectl access may fail. The recovery path is usually to work directly on a control-plane node, renew the certificates with kubeadm, and restart the control-plane static pods so they reload the new files. This is operational work, so take a backup first and move carefully.
Confirm the Cluster Uses kubeadm PKI
The commands in this article assume the cluster was bootstrapped with kubeadm and stores certificates under /etc/kubernetes/pki. If the cluster uses a different certificate management flow, the right recovery steps may be different.
Before changing anything, back up the certificate and kubeconfig material:
Then inspect certificate status on a control-plane node:
If the cluster has multiple control-plane nodes, plan to repeat the renewal on each one.
Renew the Certificates
For the common kubeadm case, renew everything with:
You can also renew individual certificates if only a subset is affected, but in an expiration recovery scenario it is often simpler to renew the whole set consistently.
kubeadm certs renew uses the existing local certificate files as the source for identity details such as subject and SAN information, so you typically do not re-enter those values during renewal.
Restart the Control-Plane Components
Renewing the files is not enough by itself. The control-plane components must reload the updated certificates. For kubeadm static pods, the official operational approach is to restart them by letting kubelet recreate them from the manifest directory.
The manifests live here:
A typical sequence for one component is:
Repeat the same pattern for kube-controller-manager.yaml, kube-scheduler.yaml, and local etcd.yaml if that node runs stacked etcd and its certificates were renewed.
The point is not the exact sleep duration by itself. The point is to let kubelet observe the manifest removal and then recreate the static pod with the renewed certificate files.
Refresh Client Access
If admin.conf was renewed, refresh your local kubeconfig copy as well:
Without this step, the control plane may be healthy again while your local client still presents an expired admin certificate.
Validate Recovery
After the control-plane components come back, verify the node and API health:
On replicated control planes, perform the renewal on each control-plane node, then re-check overall cluster health when all of them have rotated and restarted cleanly.
Common Pitfalls
The biggest mistake is treating all Kubernetes clusters the same. These steps are for kubeadm-managed PKI. Managed cloud clusters or clusters with external certificate tooling may need a different renewal process.
Another issue is renewing the files but forgetting to restart the static pods. The certificates on disk may be fresh while the running components are still using the old in-memory material.
People also often fix the control plane and forget admin.conf. That leaves kubectl broken on the administrator machine even though the cluster itself is running again.
Finally, do not skip the backup. Expired certificates are already a recovery situation, and certificate or kubeconfig mistakes are much easier to undo if you saved the original state first.
Summary
- Work directly on a control-plane node and confirm the cluster uses kubeadm-managed PKI.
- Back up
/etc/kubernetesbefore changing certificate files. - Use
kubeadm certs check-expirationto inspect the current state. - Renew the certificates with
kubeadm certs renew alland restart the control-plane static pods. - Refresh
$HOME/.kube/configfrom/etc/kubernetes/admin.confif the admin client certificate was renewed.
Related reading
- Replace contents of an item in a list using Kustomize
- Replication Controller VS Deployment in Kubernetes
- Requeue a kubernetes event in a non-blocking reconcile loop
- Required value must specify a volume type when statically provisioning PV
- Restart container within pod
- Restart pods when configmap updates in Kubernetes?
- Restart VMs in scale set in AKS Node Pool
- restartPolicy Unsupported value Never supported values Always

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.