Hi There...I have doing lab "Practice Test Backup and Restore-1" In this while r . . .

Gaurav Dubey:
Hi There…I have doing lab “Practice Test Backup and Restore-1”
In this while restoring the backup , I made changes in etcd.yaml but it still didn’t come up .
So I am trying to delete the port , but it also not getting deleted from more than 7 minutes

Chris:
@Gaurav Dubey you can try to forcefully delete the pod. kubectl delete pod <PODNAME> --grace-period=0 --force --namespace <NAMESPACE>

Gaurav Dubey:
Thankyou Chris

Alistair Mackay:
Hi @Gaurav Dubey @Chris

etcd is a static pod - you can’t delete it this way.

If the pod hasn’t come up, it means you have made a mistake in updating the pod definition. To find out why one of the system static pods isn’t starting, you can follow this guide.

https://github.com/kodekloudhub/community-faq/blob/main/docs/diagnose-crashed-apiserver.md

Gaurav Dubey:
@Alistair Mackay…Hi , thanks for pointing out . But I had deleted this using the way which Chris had suggested. And after that it successfully came back up that time.

Alistair Mackay:
Also note that kubelet does not always notice that you’ve edited a manifest. Sometimes it needs a kick

systemctl restart kubelet

After e restart it will check all manifests against what is actually running and do a reconciliation.

Chris:
@Alistair Mackay so the preferred way is to restart the kubelet if a static pod is stuck in terminating state?

Alistair Mackay:
I would try that first. Restarting kubelet doesn’t affect any pods that are running normally.

I think that kubelet uses the https://en.wikipedia.org/wiki/Inotify|inotify service to detect changes to static manifests while it is running (I would have to check the source code to know for sure). If kubelet misses an event from inotify (perhaps because it is busy), this would explain why it sometimes doesn’t pick up the changes.

When you restart kubelet, it proactively checks everything.

Chris:
Many thanks for the explanation

unnivkn:
Hi @Chris fyr, more details on static pod: https://stackoverflow.com/questions/59612514/whats-the-difference-between-pods-and-static-pods-in-kubernetes-and-when-to

Chris:
Thanks much