Restore a cluster from a snapshot
Return every Kubernetes object of a cluster to one of its verified etcd snapshots.
Replace my-cluster with your cluster's name, and etcds-0123456789ab with the snapshot's id.
Warning
Every object created after the snapshot is gone, and the Kubernetes API is down until the first new control-plane machine has restored etcd (about 5 to 10 minutes).
Prerequisites
- Permission for
eks:RestoreClusteron the cluster. - In the console, also
eks:DescribeClusterto open the cluster andeks:ListClusterSnapshotsto see the snapshots. - The cluster is
active(one restore at a time, none during an upgrade or a deletion), and the snapshot is verified.
Restore
- Open Kubernetes, open the cluster, then choose Backups.
- Under Snapshots, open the snapshot's menu and choose Restore…. Only verified snapshots have it.
- In the dialog, enter the cluster name, and choose Restore.
dcloud eks snapshots list my-cluster
dcloud eks clusters restore my-cluster --snapshot-id etcds-0123456789ab --confirm my-clusterPOST /eks/api/clusters/my-cluster/restore
{ "snapshotId": "etcds-0123456789ab", "confirm": "my-cluster" }Result
The answer is 202 with the cluster in status restoring. Then:
- On a control plane built with backups, a
pre-restoresnapshot of the current state is taken first, so the restore can be undone. The restore waits for it at most 15 minutes; if it fails or does not arrive, the restore goes on without it, and Activity says so. - Every control-plane machine is replaced. One new machine restores etcd from the snapshot and starts the control plane with the same CA, endpoint and keys, so kubeconfigs keep working.
- On
standard, the other two machines are added.
Worker nodes keep running their pods and reconnect when the API is back. Activity records each
step and who asked. A restore you start is excluded from the SLA for its first 30 minutes. When
the control plane is complete again, the cluster is active.
If the first new machine fails, or is not up within 30 minutes, the restore fails: the cluster is
failed, its error starts "Restore failed:", and Deutsche Cloud's operators are told.
Refusals
400"Confirm with the cluster’s name (my-cluster)".404"Snapshot not found" for a snapshot not of this cluster.409"Only a verified snapshot can be restored".409"The cluster is updating; a restore starts only from an active cluster (one at a time, not during an upgrade or a deletion)".