Backup ETCD
How to create an etcd snapshot backup using etcdctl with TLS certificates on a Kubernetes cluster.
To create a backup of the etcd datastore, use etcdctl snapshot save. You must specify the TLS certificates used by the etcd server, which are typically located under /etc/kubernetes/pki/etcd/ on kubeadm-based clusters. Set the ETCDCTL_API environment variable to 3 to use the v3 API.
1
2
export ETCDCTL_API=3
etcdctl snapshot save /opt/snapshot-pre-boot.db --cert=/etc/kubernetes/pki/etcd/server.crt --cacert=/etc/kubernetes/pki/etcd/ca.crt --key=/etc/kubernetes/pki/etcd/server.key
This post is licensed under CC BY 4.0 by the author.