Cloud Native 8 min read

Fix Kubernetes Certificate Expiration Errors with kubeadm Commands

When a Kubernetes cluster suddenly stops responding due to an expired x509 certificate, this guide shows how to renew all certificates using kubeadm alpha commands, copy the updated kubeconfig, restart kubelet, and verify the new expiration dates.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Fix Kubernetes Certificate Expiration Errors with kubeadm Commands

When running kubectl you may encounter the error

Unable to connect to the server: x509: certificate has expired or is not yet valid

, indicating that the cluster certificates are out of date.

Solution

Use the kubeadm alpha sub‑commands to manage and renew the certificates.

Renew all certificates: kubeadm alpha certs renew all The command outputs renewal information for each component.

Copy the newly generated admin kubeconfig to your local ~/.kube/config :

sudo kubeadm alpha kubeconfig user --client-name=admin --org=system:masters > /tmp/admin.conf
sudo cp /tmp/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

Restart the kubelet service so the cluster can use the refreshed certificates: systemctl restart kubelet Verify that the certificates have been renewed and check their new expiration dates: kubeadm alpha certs check-expiration The output lists each certificate with its new expiration date (e.g., Jan 25, 2026).

Note: In Kubernetes 1.15 the command is kubeadm certs check-expiration. In newer versions (e.g., 1.19) the certs sub‑command resides under kubeadm alpha, so replace kubeadm certs with kubeadm alpha certs to run the commands successfully.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

cloud-nativeOperationsKubernetesCertificatekubectlkubeadm
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.