

Wait 1-2 to mins for this pods to restart. Note 1: As the ETCD pod has changed it will automatically restart, and also kube-controller-manager and kube-scheduler. When this file is updated, the ETCD pod is automatically re-created as this is a static pod placed under the /etc/kubernetes/manifests directory. With this change, /var/lib/etcd on the container points to /var/lib/etcd-from-backup on the controlplane (which is what we want) We have now restored the etcd snapshot to a new path on the controlplane - /var/lib/etcd-from-backup, so, the only change to be made in the YAML file, is to change the hostPath for the volume called etcd-data from old directory ( /var/lib/etcd ) to the new directory ( /var/lib/etcd-from-backup ).
#CONTROLPLANE BACKUP UPDATE#
Next, update the /etc/kubernetes/manifests/etcd.yaml: 09:19:27.266709 I | etcdserver/membership: added member 8e9e05c52164694d [ to cluster In this case, we are restoring the snapshot to a different directory but in the same server where we took the backup ( the controlplane node) As a result, the only required option for the restore command is the –data-dir. Snapshot restore /opt/snapshot-pre-boot.db I don’t know if it’s related or not, but when I checked the /etc/systemd/system folder, there didn’t seem to be a kube-apiserver service.įirst Restore the snapshot: ETCDCTL_API=3 etcdctl -data-dir /var/lib/etcd-from-backup \ However, after the step where I modify the etcd.yaml file, I ran into the exact same error, so the expected solution to the lab’s final question is not work for me.Ĭould someone please help? I’m not certain why this error would be occurring. Eventually, I gave up, restarted the lab, and tried following the given solution in the Solution tab. This is also the data-dir that I specified when running ‘etcdctl snapshot restore’. I modified the etcd.yaml file by setting the etcd-date volume location to /var/lib/etcd-from-backup. After a couple of minutes, I keep getting this repeating error when I run any kubectl command: The connection to the server controlplane:6443 was refused - did you specify the right host or port?) On the final section, where I am supposed to restore etcd, kubectl fails to start up again after modifying the etcd.yaml file. This issue is specifically for the “PRACTICE TEST BACKUP AND RESTORE METHODS” lab under Cluster Maintenance. I was attempting the CKA labs in the " Udemy Labs - Certified Kubernetes Administrator with Practice Tests" course.
