<p>I would like to know, in which parts of the codes in kubernetes (
<a href="https://github.com/kubernetes/kubernetes" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes</a>) the scheduler talks to the API server and then the API server sends out the scheduling information to kubelet?</p>

HamiBU
<p>Scheduler register a informer to specify resource(e.g. pod, PV...), register some callback function to event(e.g. add, delete, update...), these code at: <a href="https://github.com/kubernetes/kubernetes/blob/master/pkg/scheduler/eventhandlers.go#L319" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/master/pkg/scheduler/eventhandlers.go#L319</a>. </p>

<p>Then event callback will put pod spec in the <a href="https://github.com/kubernetes/kubernetes/blob/master/pkg/scheduler/internal/queue/scheduling_queue.go" rel="nofollow noreferrer">queue</a>, scheduler will check the queue, add use some <a href="https://github.com/kubernetes/kubernetes/blob/master/pkg/scheduler/algorithm/scheduler_interface.go" rel="nofollow noreferrer">algorithm</a> to schedule the pod to some node. Finally, scheduler will update the pod information to apiserver.</p>

<p>Kubelet will check the apiserver to find which pod need update, then create the container, bind the volume...</p>

<p>p.s. It is complex to understand the whole lifecycle about how kubernetes works, please provide what you want to know exactly.</p>
