Take and Restore an etcd Snapshot on a Kubernetes Cluster
Scenario
You are a Kubernetes administrator responsible for the cluster's operational health.
As part of routine maintenance and practice, you need to create an etcd snapshot backup and restore it to verify that the backup is usable.
Task
Two tasks need to be completed:
Take a snapshot backup of the running etcd instance and save it to:
/home/laborant/etcd-backup/etcd-snapshot.db
Hint 1 — Taking an etcd Snapshot
Use etcdctl snapshot save (not etcdutl) and point to the output file path. This requires a live connection to a running etcd instance — the snapshot is streamed over the network via the etcd API.
You will need the etcd TLS certificates, which are located under /etc/kubernetes/pki/etcd/.
You can find the exact flags used by the running etcd pod by inspecting its manifest at /etc/kubernetes/manifests/etcd.yaml.
Run etcdctl snapshot save --help to see all available flags — you will need to specify --endpoints to point to the etcd server address, along with TLS flags like --cacert, --cert, and --key for secure authentication.
Documentation