'When does scheduling get applied to a pod?

As a part of my PhD thesis, I am considering to use Kubernetes as a testing platform for trying out a scheduling algorithm. This would require writing an extension to Kubernetes in the form of a scheduler. What gets me confused about Kubernetes is the matter of a pod lifecycle.

I understand that a pod goes through scheduling process before it gets deployed and started. What I don't understand is what happens when (1) we kill an instance of a pod and run a new one, similar to the one we killed, or (2) the physical node itself becomes unable to run our pod, (3) or the instance of the pod crushes?

In particular, I am trying to prove or disprove my suspicion that in such cases Kubernetes creates new instances of the pod and pushes them through the same pipeline as it would do during startup, which would guarantee that my yet to be implemented custom scheduler is triggered. That no shortcuts that would skip scheduling process are used here.

A ref. to a relevant spec. would be of a great appreciation.

Thanks a lot in advance!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source