How do you restore a cluster from an etcd snapshot?
AdvancedScenarioUpgrades, etcd, disaster recovery and incidents
Answer
Situation read → Control plane data is corrupted.
What I'd do →
- Stop kube-apiserver and etcd static pods by moving manifests out of
/etc/kubernetes/manifests etcdutl snapshot restore /backup/etcd.db --data-dir /var/lib/etcd-restore- Point the etcd manifest data dir to the restored directory
- For multi-node, restore each member with
--initial-clusterflags - Start components and verify with
kubectl get nodes
Why → Restore creates a new cluster identity, so all members must be restored consistently.
Interview tip → Rehearse this at least once.
More on Upgrades, etcd, disaster recovery and incidents
How do you back up etcd on a self-managed cluster?Beginneretcd database space exceeded: `mvcc: database space exceeded`. What now?AdvancedWalk through a kubeadm minor version upgrade.AdvancedHow do you find deprecated or removed APIs before an upgrade?IntermediateA cluster upgrade broke an operator because its CRD API version was removed. How do you recover?AdvancedWhat are the main control plane components and what does each do?Beginner