Workflow
Disaster recovery
A Talos cluster keeps its Kubernetes state in etcd on the control planes. If most control planes lose their etcd data, only a snapshot brings the state back. etcd backup explains the model.
Back up and restore etcd
1 / 8
Back up
An EtcdBackupPolicy takes a snapshot from a healthy member on a schedule. Taking a snapshot needs no approval.
pk-metal backup now labBack up. An EtcdBackupPolicy takes a snapshot from a healthy member on a schedule. Taking a snapshot needs no approval.
pk-metal backup now labEncrypt and store. The operator encrypts the snapshot to your age public keys and sends it to the sink. It holds no secret key, so it cannot read the snapshot.
spec.encryption.ageRecipients: [age1…]Verify. The operator reads the snapshot back and checks the hash. Only a Verified snapshot can be restored.
pk-metal backup list labLoss. Most control planes lose their etcd data. etcd stops. The operator does not bootstrap again, because that makes an empty cluster over your data.
Bootstrapped=False EtcdDataLostPlan. restore plan asks each control plane about etcd and prints the case. With --propose it writes a reset for each stuck member and one etcdRecover.
pk-metal restore plan lab --proposeApprove and reset. A person approves the operations one after the other. The resets wipe EPHEMERAL on the stuck control planes.
pk-metal approve pk-metal/lab-etcd-reset-node-2Upload. You decrypt the snapshot on your workstation and stream it to the node over the Talos API. The plaintext never touches a disk or the operator.
pk-metal restore upload pk-metal/lab-etcd-recover-node-1 --identity ~/.config/age/keys.txtRestored. Talos starts etcd on one node from the snapshot. The other control planes join it. Bootstrapped is True again.
kubectl get taloscluster lab
- Make an age key pair for each person who may restore.
- Write an EtcdBackupPolicy with a sink and at least two age recipients.
- Take the first snapshot with pk-metal backup and make sure that it is
Verified. - When etcd fails, start with
pk-metal restore plan. It changes nothing. - Propose the fix with
--propose. A person approves the operations, one after the other. If your site forbids self-approval, that is not the proposer. - For a lost majority, upload the snapshot with
pk-metal restore upload. - The EtcdRecover action starts etcd from the snapshot on one node. The other control planes join.
Which case is it
Section titled “Which case is it”What restore plan sees |
Case | What it proposes |
|---|---|---|
| Each member is healthy | Nothing to do | Nothing |
| One member is lost, the others have a majority | One member lost | EtcdRemoveMember, TalosReset of EPHEMERAL, WaitEtcdHealthy |
| No majority | Majority lost | A reset of each stuck member, then one EtcdRecover |
Each proposed operation has metal.platform-kit.org/override-cluster-guard and metal.platform-kit.org/ignore-window, in the name of the person who runs the restore.
The cluster is already down, so the guard and the windows must not hold the repair.
If the management cluster is lost
Section titled “If the management cluster is lost”The operator, its records and its snapshots list go with the cluster that it runs on. Only the snapshots in the S3 sink stay. Restore from a bootstrap cluster, as for a new site:
- Start kind and install the operator, see Pivot.
- Write the TalosCluster again with the annotation
os.platform-kit.org/restore-pending: "true". - Decrypt the newest snapshot with pk-metal backup.
- Restore with
talosctl, as the Talos documentation tells. - Remove the annotation when
Bootstrappedis True.
Try it in the lab
Section titled “Try it in the lab”mise run lab:backup-restore takes a snapshot, wipes etcd and restores it.
Runbooks for this flow
Section titled “Runbooks for this flow”| Symptom | Runbook |
|---|---|
| etcd has no leader or a member fails | etcd unhealthy or quorum lost |
| The management cluster is gone | Management cluster lost |
Alert PkMetalEtcdBackupStale or PkMetalEtcdBackupMissing |
Backup failing |
Alert PkMetalClusterUnavailable |
Cluster unavailable |
Alert PkMetalMetricsAbsent |
Management cluster lost |