Kubernetes version: 1.18
Cloud being used: bare-metal
Installation method: kubeadm
Host OS: Ubuntu 18.04
CNI and version: weave-net
CRI and version: docker
Hello I am trying to backup etcd cluster using the following command:
ETCDCTL_API=3 etcdctl --cacert="/etc/kubernetes/pki/etcd/ca.crt" --cert="/etc/kubernetes/pki/etcd/server.crt" --key="/etc/kubernetes/pki/etcd/server.key" --endpoints=“https://127.0.0.1:2379” snapshot save /var/lib/etcd/backup.db
but I am getting
Error: open /etc/kubernetes/pki/etcd/server.crt: permission denied
I have also tried with sudo but no progress. Any help would be greatly appreciated.
Hi!
I had the same error. Now It’s working.
The trick is to install etcdctl with the command
sudo apt install etcd-client
not with the command
sudo snap install etcd
This was the case for me too, but that in turn could be the version of etcdctl - the ‘snap install’ method installs a newer version (v3.5 I think) compared to apt-get (v3.24). Running the command inside the etcd pod itself (kubectl exec -it) was a good test that my syntax was correct.