Etcd backup and restore

Hi,

I am trying to backup and restore etcd on the kubeadm cluster I have created. However, when I run the snapshot save command, I get the following error.

ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key snapshot save /home/snapshot.db
Error: open /etc/kubernetes/pki/etcd/server.crt: permission denied

Can anyone point guide me on how this can be resolved?

Thank you

use sudo in the beginning and try if you are not executing as a root user

check the permissions of this file .
/etc/kubernetes/pki/etcd/server.crt

I am executing it as root user. I also tried to set the permission of the files to 777. Still get the same issue.

Use API server etcd client cert & key and try once.

@chandrasekharmalladi did you manage to resolve the issue. I have run into the same thing.

can you please check the user and try to disable selinux

$ sudo setenforce 0 (in case you don’t have this package you can install it using
"$ apt install selinux-utils)
$ vim /etc.sysconfig/selinux # C hange in the file