Here are a few steps to simplify backing up an ETCD Cluster:
# create an alias: alias k=kubectl # Note: I in this case ETCD is running as a pod on the Master/Controlplane node. To verify that ETCD is running as a pod on the controlplane node run: k get po -n kube-system # Locate the --cacert,--cert, and --key files listed in the etcd.yaml manifest find /etc/kubernetes/manifests => returns /etc/kubernetes/manifests/etcd.yaml # or (for a quicker reference): head -n 35 /etc/kubernetes/manifests/etcd.yaml | grep -A 20 containers # Create snapshot: ETCDCTL_API=3 etcdctl snapshot save /etc/etcd-snapshot.db \ --cacert /etc/kubernetes/pki/etcd/ca.crt \ --cert /etc/kubernetes/pki/etcd/server.crt \ --key /etc/kubernetes/pki/etcd/server.key # Check Status: ETCDCTL_API=3 etcdctl snapshot status /etc/etcd-snapshot.d
Note: If you should come across the error
-bash: etcdctl: command not found, it is a likely indicator that
etcd-client needs to be installed on your controlplane node:
# Verify OS cat /etc/*release # Ubuntu # ..runnging as root apt-get update apt-get install -y etcd-client
For more info, visit the Kubernetes Documentation.