<p>What is the nature of the relationship between Docker and Kubernetes? Is it safe to assume that ALL Docker operations done within a Pod will treat the Pod as if it is a normal host machine?</p>
<p>For example, if I were to use the Python Docker SDK, attach to the <code>/var/run/docker.sock</code>, and create a volume, will this volume only exist within the Pod?</p>
<p>My main concern is that I know a Pod is virtualized, thus may not play nicely if I dig a little too deep via other virtualization tools like Docker.</p>

jrdzha
<p>It's important to understand what the responsibility of each of these concepts is.</p>
<ul>
<li>A <strong>Docker container</strong> is in essence a boundary between the host OS and guest OS, that allows for a process to run in isolation (<a href="https://www.docker.com/resources/what-container" rel="nofollow noreferrer">docs</a>).</li>
<li><strong>Kubernetes</strong> is an orchestration platform for running such containers (<a href="https://kubernetes.io/docs/home/" rel="nofollow noreferrer">docs</a>).</li>
<li>Finally a <strong>Pod</strong> is a kubernetes object that describes how a docker container is to be run (<a href="https://kubernetes.io/docs/concepts/workloads/pods/" rel="nofollow noreferrer">docs</a>).</li>
</ul>
<p>With that knowledge we can answer some of your questions;</p>
<blockquote>
<p>What is the nature of the relationship between Docker and Kubernetes?</p>
</blockquote>
<p><a href="https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/" rel="nofollow noreferrer">Kubernetes</a> can run docker containers like your computer can, but it's optimised for this specific goal. Kubernetes is also an abstraction (or orchestration) layer, handling resources like network capability, disk space, and cpu cycles for you.</p>
<blockquote>
<p>Is it safe to assume that ALL Docker operations done within a Pod will treat the Pod as if it is a normal host machine?</p>
</blockquote>
<p>A <a href="https://kubernetes.io/docs/concepts/workloads/pods/" rel="nofollow noreferrer">Pod</a> is not a host in any way. It's merely a description of how a docker container (or multiple) should run. Any resulting containers are running in the virtual space that is created by the kubernetes Nodes.</p>
<blockquote>
<p>For example, if I were to use the Python Docker SDK, attach to the /var/run/docker.sock, and create a volume, will this volume only exist within the Pod?</p>
</blockquote>
<p>This is something you can do on your local machine, and while technically you could do this on your Node as well, it's not a common use case.</p>
<p>Note that a docker container is isolated from any external factors like a mount or a network socket (which only happen at runtime, and don't change the state of the container itself). You can however configure a container (using a Pod object) to recreate the same conditions on your cluster.</p>
