Etcdctl backup - permission denied exception

Cluster information:

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.

Thanks,
Anil

It works for me when the etcdctl version installed on my master ndode matches the etcdctl version of the etcd-master pod

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

I hope it will work for you too.