<p>I am creating a docker container ( using docker run) in a kubernetes Environment by invoking a rest API.<br>
I have mounted the docker.sock of the host machine and i am building an image and running that image from RESTAPI..<br>
Now i need to connect to this container from some other container which is actually started by Kubectl from deployment.yml file.<br>
But when used kubeclt describe pod (Pod name), my container created using Rest API is not there..  <strong>So where is this container running and how can i connect to it from some other container</strong> ?</p>

<p>Are you running the container in the same namespace as namespace with deployment.yml? One of the option to check that would be to run -</p>

<pre><code>kubectl get pods --all-namespaces
</code></pre>

<p>If you are not able to find the docker container there than I would suggest performing below steps - </p>

<ol>
<li>docker ps -a {verify running docker status}</li>
<li>Ensuring that while mounting docker.sock there are no permission errors</li>
<li>If there are permission errors, escalate privileges to the appropriate level</li>
</ol>

<p>To answer the second question, connection between two containers should be possible by referencing cluster DNS in below format - </p>

<pre><code>"&lt;servicename&gt;.&lt;namespacename&gt;.svc.cluster.local"
</code></pre>

<p>I would also request you to detail steps, codes and errors(if there are any) for me to better answer the question.</p>
