<p>Why does docker kubernetes duplicate pods? I see on the dashboard some pods with k8s and with k8s_POD even my deployments.yaml has replica=1</p>
<p>Does anyone have any ideas on this?</p>

Rafael Souza
<p>All <code>containers:</code> in a kubernetes <code>Pod</code> share the same cluster's Pod IP address, and for each one of them <code>127.0.0.1</code> is <em>the same as the others</em>. The way that magic happens is via that <code>k8s_POD_</code> container, which is the one running the <a href="https://groups.google.com/g/kubernetes-users/c/jVjv0QK4b_o" rel="nofollow noreferrer"><code>pause</code> image</a> and is the <em>only</em> container which is assigned a kubernetes Pod IP via <code>CNI</code>. All containers in that Pod then use its <a href="https://manpages.ubuntu.com/manpages/jammy/en/man7/network_namespaces.7.html" rel="nofollow noreferrer">network_namespace(7)</a> to send and receive traffic within the cluster. That's also why one can restart a <em>container</em> without it losing the IP address, unlike deleting a Pod which gets a fresh one</p>
<p>To the best of my knowledge, those sandbox containers can exist even without any of the other containers in cases where the main container workloads cannot start due to pending volumes (or other resources, such a GPUs), since the CNI allocation process happens very early in <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/" rel="nofollow noreferrer">the Pod lifecycle</a></p>
<hr />
<p><em>I could have sworn it was <a href="https://stackoverflow.com/search?q=%5Bkubernetes%5D+k8s_pod">in an existing question</a> but I wasn't able to readily find it</em></p>
