How-to guide · Operate and monitor
How to renew expired kubeadm certificates
In one sentence
Every certificate kubeadm issued on your control plane is valid again, the control-plane components run on the new files, kubectl works and the kubelets are checked.
- Platforms
- Kubernetes
- Linux
- Level
- Practitioner · 7 steps
On this page
Before you start
- A cluster built with kubeadm, and on each control-plane node the kubeadm binary that matches the cluster version.
- Root (or sudo) on every control-plane node.
- A backup of
/etc/kuberneteson each of those nodes (step 2 makes one). - The symptom:
kubectlprintsUnable to connect to the server: x509: certificate has expired or is not yet valid. That message has its own page, x509: certificate has expired or is not yet valid; this guide is the repair.
Why it matters: kubeadm init builds a small private CA under /etc/kubernetes/pki. Its certificate authorities are valid for ten years, but every leaf certificate they sign, including the client certificate in admin.conf, for one year. After a year without an upgrade, kube-apiserver rejects the expired client certificates with Go’s X.509 expiry error. Workloads keep running during the repair; the API on each node is down for about a minute while its static Pods restart.
Steps
1. Read the expiry report
Run this on a control-plane node. It reads the files on disk, so it works while the API is refusing you.
sudo kubeadm certs check-expiration
CERTIFICATE EXPIRES RESIDUAL TIME CERTIFICATE AUTHORITY EXTERNALLY MANAGED
admin.conf Oct 20, 2026 07:41 UTC <invalid> ca no
apiserver Oct 20, 2026 07:41 UTC <invalid> ca no
apiserver-etcd-client Oct 20, 2026 07:41 UTC <invalid> etcd-ca no
apiserver-kubelet-client Oct 20, 2026 07:41 UTC <invalid> ca no
controller-manager.conf Oct 20, 2026 07:41 UTC <invalid> ca no
etcd-healthcheck-client Oct 20, 2026 07:41 UTC <invalid> etcd-ca no
etcd-peer Oct 20, 2026 07:41 UTC <invalid> etcd-ca no
etcd-server Oct 20, 2026 07:41 UTC <invalid> etcd-ca no
front-proxy-client Oct 20, 2026 07:41 UTC <invalid> front-proxy-ca no
scheduler.conf Oct 20, 2026 07:41 UTC <invalid> ca no
super-admin.conf Oct 20, 2026 07:41 UTC <invalid> ca no
CERTIFICATE AUTHORITY EXPIRES RESIDUAL TIME EXTERNALLY MANAGED
ca Oct 18, 2035 07:41 UTC 8y no
etcd-ca Oct 18, 2035 07:41 UTC 8y no
front-proxy-ca Oct 18, 2035 07:41 UTC 8y no
How to read it:
admin.conf,controller-manager.conf,scheduler.confandsuper-admin.confare kubeconfig files in/etc/kuberneteswith a client certificate embedded as base64.super-admin.confexists since Kubernetes 1.29, normally only on the node where you rankubeadm init; it is the break-glass identity insystem:masters, and kubeadm skips it where it is missing.apiserveris the serving certificate on port 6443.apiserver-kubelet-clientandfront-proxy-clientare what kube-apiserver presents to kubelets and to aggregated API servers.apiserver-etcd-client,etcd-server,etcd-peerandetcd-healthcheck-clientare the etcd side, signed byetcd-ca.kubelet.confis deliberately absent: it points at a certificate under/var/lib/kubelet/pkithat the kubelet rotates itself (step 7).EXTERNALLY MANAGEDyesmeans this node holds a CA certificate without its key, so kubeadm cannot sign (see “If something goes wrong”).
If the CA rows have expired too, stop here: that needs a CA rotation, which this guide does not cover.
2. Back up /etc/kubernetes
Renewal overwrites certificates and kubeconfig files in place. The copy holds the private keys of the CAs, so keep it readable by root only.
sudo cp -a /etc/kubernetes "/root/kubernetes-backup-$(date +%F)"
3. Renew every certificate
sudo kubeadm certs renew all
[renew] Error reading configuration from the Cluster. Falling back to default configuration
certificate embedded in the kubeconfig file for the admin to use and for kubeadm itself renewed
certificate for serving the Kubernetes API renewed
certificate the apiserver uses to access etcd renewed
... one line per certificate ...
certificate embedded in the kubeconfig file for the super-admin renewed
Done renewing certificates. You must restart the kube-apiserver, kube-controller-manager, kube-scheduler and etcd, so that they can use the new certificates.
The error line is kubeadm failing to read the kubeadm-config ConfigMap through the expired admin.conf and carrying on. Renewal does not need it: kubeadm takes the common name, organisation and SANs from the existing certificates, signs with the CA keys in /etc/kubernetes/pki, and reissues every certificate whether or not it has expired. To renew one, use its name from the report: kubeadm certs renew apiserver.
4. Restart the control-plane static Pods
Not every component reloads certificate files while running. They are static Pods: the kubelet runs them from /etc/kubernetes/manifests, and the Pod objects kubectl shows are mirrors, so deleting those changes nothing. The documented way is to move the manifests out, wait at least 20 seconds (the kubelet’s fileCheckFrequency) for the Pods to stop, then move them back.
sudo mkdir -p /etc/kubernetes/manifests-paused
sudo mv /etc/kubernetes/manifests/*.yaml /etc/kubernetes/manifests-paused/
sleep 30
sudo crictl ps | grep -E 'kube-apiserver|kube-controller-manager|kube-scheduler|etcd'
sudo mv /etc/kubernetes/manifests-paused/*.yaml /etc/kubernetes/manifests/
The crictl ps line prints nothing while the manifests are out; a minute after moving them back, its CREATED column shows fresh containers. Keep the paused directory outside /etc/kubernetes/manifests, because the kubelet reads every file in there whatever its extension. With several control-plane nodes behind a load balancer, do one at a time.
5. Refresh your kubeconfig
Step 3 rewrote /etc/kubernetes/admin.conf on the node. Every other copy still carries the expired client certificate, including the one in your home directory.
sudo cp -i /etc/kubernetes/admin.conf "$HOME/.kube/config"
sudo chown "$(id -u):$(id -g)" "$HOME/.kube/config"
kubectl get nodes
Redistribute it to the laptops and CI runners that hold a copy. Kubeconfig files made with kubeadm kubeconfig user carry their own certificate (valid for one year by default) and renew all does not touch them; generate them again.
6. Repeat on every control-plane node
Each control-plane node holds its own leaf certificates and kubeconfig files, signed by the shared CAs, and kubeadm certs renew all only touches the node it runs on. Run steps 1 to 5 on each of them.
7. Check the kubelets
Each kubelet authenticates to kube-apiserver with a client certificate, so that connection is mutual TLS. kubeadm sets rotateCertificates to true in the KubeletConfiguration (the field’s own default is false). Near expiry the kubelet asks the certificates API for a new certificate, kube-controller-manager signs it for one year (--cluster-signing-duration) under kubeadm’s default auto-approval, and the /var/lib/kubelet/pki/kubelet-client-current.pem symlink that kubelet.conf points at moves to the new file. kubeadm certs renew never touches these.
Rotation needs a working API server. If the control plane was down when a kubelet reached its own expiry, or the node was off for months, the kubelet cannot authenticate to ask for a new certificate. Check each node:
sudo openssl x509 -noout -enddate -in /var/lib/kubelet/pki/kubelet-client-current.pem
If notAfter is in the past, re-bootstrap the node as the kubeadm troubleshooting page describes. First move the old files aside:
sudo mkdir -p /root/kubelet-bak
sudo mv /etc/kubernetes/kubelet.conf /var/lib/kubelet/pki/kubelet-client* /root/kubelet-bak/
On a control-plane node that has /etc/kubernetes/pki/ca.key, issue a kubeconfig for the node’s identity and copy it to /etc/kubernetes/kubelet.conf on the failed node, adjusting the cluster name and server endpoint or passing --config. Without ca.key, your external CA must sign the embedded certificate.
NODE=worker-1
sudo kubeadm kubeconfig user --org system:nodes --client-name "system:node:$NODE" > kubelet.conf
On the failed node, restart the kubelet and wait for the symlink to reappear. Then edit kubelet.conf so client-certificate and client-key both read /var/lib/kubelet/pki/kubelet-client-current.pem in place of client-certificate-data and client-key-data, restart the kubelet again and confirm the node is Ready.
sudo systemctl restart kubelet
sudo ls -l /var/lib/kubelet/pki/kubelet-client-current.pem
The kubelet’s serving certificate is separate: by default a self-signed certificate the kubelet makes itself. With serverTLSBootstrap: true it requests a signed one through the kubernetes.io/kubelet-serving signer instead, which nothing approves automatically: run kubectl get csr and kubectl certificate approve for each, and again in one year.
Check it worked
On each control-plane node, check the files, the running API server and the API itself:
sudo openssl x509 -noout -enddate -in /etc/kubernetes/pki/apiserver.crt
sudo kubeadm certs check-expiration
echo | openssl s_client -connect 127.0.0.1:6443 2>/dev/null | openssl x509 -noout -enddate
kubectl get nodes
kubectl get --raw='/readyz?verbose'
The first line reads the file on disk; the report should now show about one year of residual time on every row, with the CA rows unchanged. The s_client line shows the certificate the live kube-apiserver presents; an old notAfter there means step 4 did not take effect on this node. Every node should be Ready and every readyz line should end in ok. To read a renewed certificate field by field, paste it into the certificate decoder.
If something goes wrong
kubectlstill printsx509: certificate has expired or is not yet valid. Check the kubeconfig you are using, not the one on the node: a copy taken fromadmin.conflong ago is the usual cause.kubectl config view --raw --minify -o jsonpath='{.users[0].user.client-certificate-data}' | base64 -d | openssl x509 -noout -enddateshows the date inside it.- The kubeconfig is new and the error stays. Run the
s_clientline above: an old date means the static Pods never restarted and still serve the old certificate; repeat step 4. Ifkubectlworks on one node but not through the load balancer, the other control-plane nodes are not done yet (step 6). - One node is
NotReadyand the kube-apiserver log showsx509: certificate has expiredfor it. That is the kubelet’s client certificate: do step 7 for that node. On a node created before kubeadm 1.17,kubelet.confembeds the certificate instead of pointing at the symlink, so rotation leaves it stale; point it atkubelet-client-current.pemas in step 7. - etcd runs outside the cluster. With external etcd, kubeadm did not issue the etcd certificates and does not manage them. Renew them wherever etcd runs, with whatever issued them, then restart the API servers.
- The report says
EXTERNALLY MANAGED yes. kubeadm is in external CA mode and produces certificate signing requests instead:kubeadm certs generate-csrwrites.csrand.keypairs under/etc/kubernetes/pki, and.csrand.confpairs for the kubeconfig files under/etc/kubernetes. Sign them with your CA, save each certificate as.crtbeside its key or base64-encode it into the kubeconfig’sclient-certificate-data, then continue from step 4. Asking for a certificate explains what the CA sees in each request. kubectlnow saysx509: certificate signed by unknown authority. Someone regenerated the CA, typically by deleting/etc/kubernetes/pkiand runningkubeadm init phase certs all, which mints a new CA when none is present; nothing in the cluster trusts the API server any more. Restore/etc/kubernetes/pkifrom the step 2 backup and start again.
Why this works
A kubeadm control plane is a private CA with its signing keys on disk, so renewal is local: kubeadm reads each existing certificate, builds a new one with the same names and a fresh validity period, and signs it with the CA key next to it. So nothing leaves the node unless you chose external CA mode, and the CA rows must still be valid. The components need a restart because dynamic reload is not supported for every component and certificate. A CA of your own covers what a CA key on disk implies, and Inventory, expiry and renewal why issuance, renewal and rotation are separate jobs. Since Kubernetes v1.15.0, kubeadm upgrade apply and kubeadm upgrade node also renew every kubeadm-managed certificate on the node, kubeconfig files included (--certificate-renewal defaults to true), so a cluster upgraded yearly never reaches this page.
Go deeper
- Certificate management with kubeadm: check-expiration, renewal, external CA mode and kubelet serving certificates.
- kubeadm certs: the subcommand reference.
- kubeadm upgrade: renewal during upgrades and
--certificate-renewal. - Troubleshooting kubeadm: kubelet client certificate rotation fails: the re-bootstrap steps.
- TLS bootstrapping: how kubelets get and rotate their certificates.
- KubeletConfiguration (v1beta1):
rotateCertificates,serverTLSBootstrapandfileCheckFrequency.
Early edition. Written with AI assistance and checked against primary sources; an independent expert review is planned. Found a mistake? Tell us.