feat(etcd): add etcd snapshot backups to S3 - #121
Conversation
|
thanks for your contribution, but we will not be merging this PR. we didn't have any contribution guidelines so far (and sorry for that, you couldn't know), but we have now (#122), where we explain that topf aims to remain minimal (and therefore maintainable), and we will not re-implement an etcd snapshot is something requiring only few bash commands to be completed, and the backup towards S3 is better handled by a software that's specifically done for that (e.g. even better the snapshot should be backed up properly (and encrypted) with here are a few lines which do just that: export CP_NODE=$(topf nodes -o yaml | yq '.[] | select(.node.role == "control-plane") | .node.host' | head -1)
topf talosconfig > ./talosconfig && export TALOSCONFIG=$(pwd)/talosconfig;
talosctl etcd snapshot -n $CP_NODE /tmp/etcd-snapshot.db
kopia snapshot create /tmp/etcd-snapshot.dbI hope you see my point: it's a bit like the UNIX philosophy, each binary does one thing (well) and you combine them together [EDIT]: for the restore, what's needed is something like |
|
Hey @clementnuss, no problem understood. For some extra context the reason I built this is I found that talosctl only gets you part of the way there as you have shown. You still have to work out which control plane node is actually But I appreciate if this is not the direction the project wants to go, thanks for taking a look :) |
Adds
topf etcd backup createandtopf etcd backup listfor backing up etcdto S3-compatible storage (AWS, MinIO, Ceph, R2), configured in topf.yaml:
The block is nested under
backupsso other storage backends can be addedlater. Credentials can be set inline (SOPS-encryptable like other fields) or
come from the usual chain (env vars, shared credentials file, IAM etc...).
createstreams a snapshot from the first reachable control-plane node(respects
--nodes-filter, skips maintenance mode), verifies it offline beforeuploading, then uploads the snapshot and a small
.meta.yamlmanifest with size,checksum, etcd revision and key count.
I would also like to create a PR at some point for restore functionality.