RODRIGO De Faria Custodio:
Hi team, I am trying to complete the Practice Lab 132. Backup and Restore Methods. I managed to make a back up of etcd, but when I try to stop the kube-apiserver as instructed in the lecture with the following command “service kube-apiserver stopped” I get the following message: “Failed to stop kube-apiserver.service: Unit kube-apiserver.service not loaded.”. Has anyone come across this. I did a bit of research in stack overflow with bing chat, they suggest to check the status of kubelet, which is running. They also suggest ways to start the service with systemctl commands, but nothing works. Thanks for the help.
nitish gavankar:
I am not from KodeKloud. SO please do not consider my answer as final
I had similar doubt. See this thread. It might help
https://kodekloud.slack.com/archives/CHMV3P9NV/p1695290768101709
Alistair Mackay:
In this lab, etcd is running a a static pod not a service, this is why systemctl doesn’t work.
To stop a static pod, you move its manifest file out of /etc/kubernetes/manifests
mv /etc/kubernetes/manifests/kube-apiserver.yaml /tmp/
API server will stop.
Do stuff, then
mv /tmp/kube-apiserver.yaml /etc/kubernetes/manifests/
API server will start again - providing you didn’t bork etcd!
RODRIGO De Faria Custodio:
Thanks Alistair, it worked. I suppose during the exam it will be running as a service right?
Alistair Mackay:
In the exam it could be running as a service, i.e. external etcd. This is why we have the backup and restore methods 2 lab, which has 2 clusters - one with stacked and one with external etcd.