<p>How does Kubernetes create Pods?</p>

<p>I.e. what are the sequential steps involved in creating a Pod, is  it implemented in Kubernetes? </p>

<p>Any code reference in Kubernetes repo would also be helpful.</p>

<p>A <strong>Pod</strong> is described in a definition file, and ran as a set of Docker containers on a given host which is part of the Kubernetes cluster, much like <code>docker-compose</code> does, but with several differences.</p>

<p>Precisely, a Pod always contains multiple Docker containers, even though, only the containers defined by the user are usually visible through the API: A Pod has one container that is a placeholder generated by the Kubernetes API, that will hold the IP for the Pod (so that when a Pod is restarted, it's actually the client containers that are restarted, but the placeholder container remains and keeps the same IP, unlike in straight Docker or docker-compose, where recreating a composition or container changes the IP.)</p>

<p>How Pods are scheduled, created, started, restarted if needed, re-scheduled etc... it a much longer story and very broad question.</p>
