Backup of etcd Database Flashcards
How to find the location of the etcd daemon data directory?
This can be identified by the –data-dir value in /etc/kubernetes/manifests/etcd.yaml
How to log into the etcd container?
kubectl -n kube-system exec -it etcd-[name] – sh
Once logged into the etcd container, how to list the options available for the etcdctl command?
etcdctl -h
What is the command for interacting with the etcd database?
etcdctl
Newer versions of etcd image have been minimized, as a result ‘find’ command and ‘ls’ command may be missing. What command can be used as an alternative to view the files in the current directory?
echo *
Is TLS needed to use etcdctl command?
Yes
What are the three files needed to be passed with the etcdctl command in order to use it?
- Certificate Authority: /etc/kubernetes/pki/etcd/ca.crt
- Server Certificate: /etc/kubernetes/pki/etcd/server.crt
- Server Key: /etc/kubernetes/pki/etcd/server.key
How to pass the certificates to etcdctl command via environment variables from kubectl?
ETCDCTL_CACERT=/etc/kubernetes/pki/etcd/ca.crt ETCDCTL_CERT=/etc/kubernetes/pki/etcd/server.crt ETCDCTL_KEY=/etc/kubernetes/pki/etcd/server.key
Show the full command to etcdctl to retrieve the member list via passing certs through environment variables
kubectl -n kube-system exec -it etcd-master – sh -c “ETCDCTL_API=3 ETCDCTL_CACERT=/etc/kubernetes/pki/etcd/ca.crt ETCDCTL_CERT=/etc/kubernetes/pki/etcd/server.crt ETCDCTL_KEY=/etc/kubernetes/pki/etcd/server.key etcdctl –endpoints=https://127.0.0.1:2379 member list
In addition to backup of snapshot of etcd database, what else should be backed up in case the node becomes unavailable?
/root/kubeadm-config.yaml
/etc/kubernetes/pki/etcd