kubeadm and etcd Cheatsheet

← All cheatsheets
$ kubeadm certs check-expiration
AdvancedCluster OpsUpdated October 2026

Bootstrap and upgrade clusters with kubeadm, manage certificates and nodes, and back up and restore etcd.

Bootstrap and join

kubeadm init --pod-network-cidr=10.244.0.0/16Create a control plane
kubeadm init --control-plane-endpoint "lb.example.com:6443" --upload-certsCreate an HA control plane behind a load balancer
kubeadm token create --print-join-commandPrint a fresh worker join command
kubeadm resetUndo kubeadm changes on a node

Upgrades and nodes

Upgrade one minor version at a time. Replace v1.x.y with your target version.

kubeadm upgrade planSee available upgrades
kubeadm upgrade apply v1.x.yUpgrade the first control plane node
kubeadm upgrade nodeUpgrade other control plane and worker nodes
kubectl drain node-1 --ignore-daemonsets --delete-emptydir-dataMove workloads off a node
kubectl uncordon node-1Allow scheduling again

Certificates

kubeadm certs check-expirationShow when certs expire
kubeadm certs renew allRenew all control plane certs
kubeadm kubeconfig user --client-name=janeCreate a kubeconfig for a user

etcd backup and restore

The etcdctl commands need the TLS flags shown in the first row. Paths below are kubeadm defaults.

ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key snapshot save /backup/etcd.dbTake a snapshot
etcdutl snapshot status /backup/etcd.db -w tableCheck the snapshot
etcdutl snapshot restore /backup/etcd.db --data-dir /var/lib/etcd-restoreRestore to a new data dir
etcdctl endpoint health --clusterCheck member health (add TLS flags)
etcdctl member list -w tableList members (add TLS flags)
etcdctl endpoint status -w tableShow leader and DB size (add TLS flags)
etcdctl defragReclaim space (add TLS flags)