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.

Task
Operate and monitor
Platforms
  • Kubernetes
  • Linux
Who it is for
Level
Practitioner · 7 steps
On this page
  1. Before you start
  2. Steps
  3. 1. Read the expiry report
  4. 2. Back up /etc/kubernetes
  5. 3. Renew every certificate
  6. 4. Restart the control-plane static Pods
  7. 5. Refresh your kubeconfig
  8. 6. Repeat on every control-plane node
  9. 7. Check the kubelets
  10. Check it worked
  11. If something goes wrong
  12. Why this works
  13. Go deeper

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/kubernetes on each of those nodes (step 2 makes one).
  • The symptom: kubectl prints Unable 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.conf and super-admin.conf are kubeconfig files in /etc/kubernetes with a client certificate embedded as base64. super-admin.conf exists since Kubernetes 1.29, normally only on the node where you ran kubeadm init; it is the break-glass identity in system:masters, and kubeadm skips it where it is missing.
  • apiserver is the serving certificate on port 6443. apiserver-kubelet-client and front-proxy-client are what kube-apiserver presents to kubelets and to aggregated API servers.
  • apiserver-etcd-client, etcd-server, etcd-peer and etcd-healthcheck-client are the etcd side, signed by etcd-ca.
  • kubelet.conf is deliberately absent: it points at a certificate under /var/lib/kubelet/pki that the kubelet rotates itself (step 7).
  • EXTERNALLY MANAGED yes means 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

  • kubectl still prints x509: certificate has expired or is not yet valid. Check the kubeconfig you are using, not the one on the node: a copy taken from admin.conf long ago is the usual cause. kubectl config view --raw --minify -o jsonpath='{.users[0].user.client-certificate-data}' | base64 -d | openssl x509 -noout -enddate shows the date inside it.
  • The kubeconfig is new and the error stays. Run the s_client line above: an old date means the static Pods never restarted and still serve the old certificate; repeat step 4. If kubectl works on one node but not through the load balancer, the other control-plane nodes are not done yet (step 6).
  • One node is NotReady and the kube-apiserver log shows x509: certificate has expired for it. That is the kubelet’s client certificate: do step 7 for that node. On a node created before kubeadm 1.17, kubelet.conf embeds the certificate instead of pointing at the symlink, so rotation leaves it stale; point it at kubelet-client-current.pem as 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-csr writes .csr and .key pairs under /etc/kubernetes/pki, and .csr and .conf pairs for the kubeconfig files under /etc/kubernetes. Sign them with your CA, save each certificate as .crt beside its key or base64-encode it into the kubeconfig’s client-certificate-data, then continue from step 4. Asking for a certificate explains what the CA sees in each request.
  • kubectl now says x509: certificate signed by unknown authority. Someone regenerated the CA, typically by deleting /etc/kubernetes/pki and running kubeadm 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/pki from 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

Guided mission · free · no account · progress saves herePrevent the next expiry outage — 6 minutesBuild an inventory and renewal workflow, then verify what every live endpoint actually presents.

Early edition. Written with AI assistance and checked against primary sources; an independent expert review is planned. Found a mistake? Tell us.

Last reviewed Edition 0.9