Follow these steps to back up etcd data by creating an etcd snapshot and backing up static Kubernetes API server resources. This backup can be saved and used at a later time if you need to restore etcd.
You should only save a backup from a single master host. You do not need a backup from each master host in the cluster.
Prerequisites
-
SSH access to a master host.
Procedure
-
Access a master host as the root user.
-
Run the
etcd-snapshot-backup.sh
script and pass in the location to save the backup to.$ sudo /usr/local/bin/etcd-snapshot-backup.sh ./assets/backup
In this example, the etcd snapshot and static Kubernetes API server resources are saved to
./assets/backup/snapshot_db_kuberesources_<datetimestamp>.tar.gz
on the master host.