K8sCalc

kubernetes

Kubernetes Certificate Expiry Calculator

Calculate when your Kubernetes certificates expire and whether you need to renew them. kubeadm certificates are valid for 1 year — missing renewal breaks the cluster.

Kubernetes PKI Certificate Management

Kubernetes uses a PKI (Public Key Infrastructure) to secure all internal communication. kubeadm generates these certificates at cluster creation with a 1-year validity period.

Certificates kubeadm Issues

CertificatePurposeValidity
apiserverAPI server TLS1 year
apiserver-kubelet-clientAPI server → kubelet auth1 year
apiserver-etcd-clientAPI server → etcd auth1 year
etcd-serveretcd peer + client TLS1 year
front-proxy-clientAPI aggregation layer1 year

The CA Certificate

The root CA certificate is valid for 10 years (not 1 year). You cannot renew the CA with kubeadm certs renew — replacing it requires rotating all cluster certificates. This is a major operation. Plan for CA rotation every 8–9 years.

Automatic Renewal via Upgrade

kubeadm upgrade apply automatically renews certificates expiring within 6 months. This is the primary reason you should upgrade Kubernetes regularly — annual minor version upgrades keep certificates healthy.

Emergency Renewal

If certificates are already expired, the process is:

  1. 1.Restore a valid kubeconfig if kubectl is broken (copy from /etc/kubernetes/admin.conf)
  2. 2.Run kubeadm certs renew all
  3. 3.Restart control plane pods
  4. 4.Distribute new kubeconfig to users

Certificate Monitoring

Add a Prometheus alert on x509_cert_expiry metric (exposed by cert-manager or kube-state-metrics) to get alerts 30, 14, and 7 days before expiry.

Frequently Asked Questions

How do I check when my Kubernetes certificates expire?

Run `kubeadm certs check-expiration` on a control plane node. It shows expiry dates for all certificates including the API server cert, etcd certs, and the front-proxy cert.

What happens when Kubernetes certificates expire?

When the API server certificate expires, kubectl stops working entirely — the API server refuses connections. etcd certificate expiry is even more severe — the entire cluster becomes read-only then unavailable. Renew before 30 days remaining.

Does upgrading Kubernetes renew certificates automatically?

Yes — kubeadm upgrade apply automatically renews all certificates that expire within 6 months during the upgrade. This is why regular minor version upgrades are important for certificate hygiene.

How do I renew certificates without upgrading?

Run `kubeadm certs renew all` on each control plane node, then restart the static pods: `crictl pods | grep kube | awk '{print $1}' | xargs crictl stopp`. The API server, scheduler, and controller-manager will restart with new certs.

Related Tools

Related Guides