<p>Found this example for Kubernetes EmptyDir volume</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: www
spec:
  containers:
  - name: nginx
    image: nginx
    volumeMounts:
    - mountPath: /srv/www
      name: www-data
      readOnly: true
  - name: git-monitor
    image: kubernetes/git-monitor
    env:
    - name: GIT_REPO
      value: http://github.com/some/repo.git
    volumeMounts:
    - mountPath: /data
      name: www-data
  volumes:
  - name: www-data
    emptyDir: {}
</code></pre>

<p>I want to volume mount between 2 pods. I am creating these pods using 2 different Replication Controllers. The replication controllers looks like this</p>

<p>Replication Controller 1:</p>

<pre><code>apiVersion: v1
kind: ReplicationController
metadata:
  name: node-worker
  labels:
    name: node-worker
spec:
  replicas: 1
  selector:
    name: node-worker
  template:
    metadata:
      labels:
        name: node-worker
    spec:
      containers:
      -
        name: node-worker
        image: image/node-worker
        volumeMounts:
          - mountPath: /mnt/test
            name: deployment-volume
      volumes:
        - name: deployment-volume
          emptyDir: {}
</code></pre>

<p>Replication Controller 2:</p>

<pre><code>apiVersion: v1
    kind: ReplicationController
    metadata:
      name: node-manager
      labels:
        name: node-manager
    spec:
      replicas: 1
      selector:
        name: node-manager
      template:
        metadata:
          labels:
            name: node-manager
        spec:
          containers:
          -
            name: node-manager
            image: image/node-manager
            volumeMounts:
              - mountPath: /mnt/test
                name: deployment-volume
          volumes:
            - name: deployment-volume
              emptyDir: {}
</code></pre>

<p>Can Kubernetes emptyDir volume be used for this scenario?</p>

<p>EmptyDir volumes are inherently bound to the lifecycle of a single pod and can't be shared amongst pods in replication controllers or otherwise.  If you want to share volumes amongst pods, the best choices right now are NFS or gluster, in a persistent volume.  See an example here: <a href="https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/README.md" rel="nofollow noreferrer">https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/README.md</a></p>
