<p>I am new to kubernetes world.
I have a cluster setup where multiple nodes are running different containers.
I want to migrate the setup to kubernetes.
I am planning to install kubernetes master on one of the node and prepare other nodes as kubernetes worker.</p>
<p>If I prepare a kubernetes cluster will kubernetes detect existing running containers on these hosts ?
If not is there any plugin/facility which will create corresponding kubernetes objects for the running containers ?</p>

Rahul Vedpathak
<p>I would essentially start from scratch here.  Kubernetes can use your existing Docker <em>images</em>, but it should have its own dedicated hardware, and you'll need to write new YAML files to deploy it.</p>
<p>Kubernetes only knows about containers it manages itself.  In most cases Kubernetes wants to manage multiple entire nodes exclusively; it doesn't make sense to run a node &quot;partly Kubernetes&quot; with some manually-managed containers.  If you can use components like the <a href="https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler" rel="nofollow noreferrer">cluster autoscaler</a> then nodes can be dynamically added and removed based on actual cluster load, outside of your direct control; anything that was on a node that gets removed will just be lost if Kubernetes doesn't know to relocate it somewhere else.</p>
<p>There are tools like <a href="https://kompose.io" rel="nofollow noreferrer">Kompose</a> to try to migrate a Docker Compose setup to Kubernetes YAML, but they're limited, and you need to actually learn the Kubernetes setup to work around these limitations.  The most prominent example is bind-mounted host directories: you can't directly use host files in Kubernetes (...from which host?) and Kompose just drops the volume mount.  To fix this you need to learn about Secrets and ConfigMaps, and Kubernetes's abstract notion of a &quot;volume&quot;, and where it fits in a Pod spec and then a Deployment spec; if you have a good handle on this then you can just directly write the Kubernetes YAML.</p>
