<p>I'm using coreos tectonic sandbox. My deployment.yaml file contains the container which should detect the docker daemon running on host via kubernetes. 
The container uses docker daemon to identify docker events. For some reason docker daemon is not getting detected. </p>

<pre><code>deployment.yaml

containers: 
  - name: idn-docker
    image: sample/id-docker:latest
      - name: docker-socket
        mountpath: /var/run/docker.sock
</code></pre>

<p>can some please help me identify what the problem is.</p>

<p>For run Docker in a Docker, you have 2 options - DooD (Docker out of Docker) and DinD (Docker in Docker). I think you need a first because you need access to events on a host machine.</p>
<p>Here is a good <a href="https://applatix.com/case-docker-docker-kubernetes-part-2/" rel="nofollow noreferrer">article</a> about both schemes.</p>
<p>Example of pod's configuration:</p>
<pre><code>apiVersion: v1 
kind: Pod 
metadata: 
  name: idn-docker 
spec: 
  containers: 
  - name: idn-docker
    image: sample/id-docker:latest
    volumeMounts: 
      - mountPath: /var/run 
        name: docker-sock 
volumes: 
  - name: docker-sock 
    hostPath: 
        path: /var/run 
</code></pre>
<p>You can use a <code>containers</code> section from an example in your deployment because of its structure in <code>template</code> section is the same Pod template as a separate pod configuration.</p>
<p>But, please keep in mind, that solution will have some limitations:</p>
<blockquote>
<p><em>Pod Networking</em> - Cannot access the container using Pod IP.</p>
<p><em>Pod Lifecycle</em> - On Pod termination, this container will keep running especially if the container was started with -d flag.</p>
<p><em>Pod Cleanup</em> - Graph storage will not be clean up after pod terminates.</p>
<p><em>Scheduling and Resource Utilization</em> - Cpu and Memory requested by Pod, will only be for the Pod and not the container spawned from the Pod. Also, limits on CPU and memory settings for the Pod will not be inherited by the spawned container.</p>
</blockquote>
