Etcd restore practice

Hello need some clarity on restore, I see from killer.sh the controlplane components are being stopped before carrying on a restore, and they are still using endpoint, cacert, cert and key with the etcdctl restore command. Is it necessary to stop controlplane components or should I just use servicekube-apiserver stop as mentioned in the lectures?

Hello @cambell79,
No need to stop the controlplane components.
Kindly check the following steps in this link GitHub - mmumshad/kubernetes-cka-practice-test-solution-etcd-backup-and-restore: This is the solution to the practice test for backing up and restoring an ETCD Cluster.

Thanks,
KodeKloud Support

In the solution videos he mentioned there is no need to pass endpoints, cacer, cert etc when doing restore but in this github article I see he did something else. What is really the ideal way to do this? I’m sitting for the exam on thursday need clarity on this please

Hello @cambell79,
Yes, you should use certificates and endpoints in your backup and restore commands.

Thanks. Last clarification please on the etcd restore. I understand in the exam you can ssh between nodes passwordless. How do you copy files or a dir from the base node to master for example without password authentication? I’m practicing on killer.sh and it keeps asking for password when using scp

Hello @cambell79,
No password, you just should back to the base node and use base-node$ scp user@<master hostname>:<files> /path/on/basenode

What about this:
scp /opt/course/1/contexts/pod.yaml root@node01:/root
pod.yaml 100% 230 506.1KB/s 00:00

I created a pod.yaml in this dir and I was able to copy this whole dir from controlplane to node01 using this command.
I don’t understand the command you sent. Sorry still new to linux

Hello @cambell79,
Assume that your base node is the local node and the master is the remote node. so this is the syntax of the command scp <remote_username>@<remote_node>:<File_Path> <LocalFileLocation>

HI Ayman, i was taking CKA exam simulator in killer sh and when i used scp command to copy a file from controlplane node (remote) t0 worker node (base node). its asking for controlplane password. please see below -

scp root@cluster3-controlplane:/etc/filename /tmp/
#replaced root with k8s as well
The authenticity of host cluster3-controlplane cannot be established.
Are you sure you want to continue connecting? Yes
password for root@cluster3-controlplane:

@Sruthi-Reddy Usually these kinds of labs or mock exams have a jump host, and you can get from the jump host to any other host you care about. But you can’t get from one of the remote hosts to another remote host. I’m guessing that when you ran this command, you were at a remote host. So you need to get back to the jump host, and try the command from there.