<p>I understand that <code>kubelet</code> is responsible for taking PodSpecs (usually from the API Server) and running the Pod.</p>
<blockquote>
<p><strong><a href="https://kubernetes.io/docs/concepts/overview/components/#node-components" rel="nofollow noreferrer">Kubernetes Components &gt; Node Components &gt; kubelet</a></strong></p>
<p>&quot;The kubelet takes a set of PodSpecs that are provided through various mechanisms and ensures that the containers described in those PodSpecs are running and healthy.&quot;</p>
</blockquote>
<p>But how does the API Server keep track of the status of each Pod (e.g. running / failed) ? Does <code>kubelet</code> send regular requests to the API Server? Or does the API Server poll <code>kubelet</code> regularly? Or some other mechanism?</p>

dayuloli
<p>kubelet does everything on the node. A typical process to create a pod would be the following:</p>

<ol>
<li>By default, kubelet is hooked up to api-server through this "thing" called <em>watch</em>. It's a sort of pub/sub. So kubelet would be subscribed to "create pod" event, and api-server would notify it when a pod needs to be created.</li>
<li>kubelet would get the container runtime (docker or rkt), along with other pod specifications, and would create the pod.</li>
</ol>

<p>Note: There are more components involved here, like scheduler and controller manager (mentioned in your post as various mechanisms), but I will skip them.</p>

<ol start="3">
<li>kubelet will make the necessary liveness and readiness probes and report back to api-server the status. Say success!</li>
<li>api-server will update etcd (by adding the metadata of the pod) to keep the track of what is going on in the cluster.</li>
</ol>

<p>At this point kubelet will be in charge of this pod. If the pod goes down, kubelet will report api-server, api-server will give the order to kill the pod, will spin up a new one, and again will update etcd server.</p>

<p>One thing to point out is that all components in k8s talk to api-server directly. So, controller manager or scheduler do not say kubelet what to do. Rather they say it to api-server, and api-server to kubelet.</p>
