``` apiVersion: v1 kind: Pod metadata: name: two-containers spec: restartP . . .

thayalan ramanathan:

apiVersion: v1
kind: Pod
metadata:
  name: two-containers
spec:

  restartPolicy: Never

  volumes:
  - name: shared-data
    emptyDir: {}

  containers:

  - name: nginx-container
    image: nginx
    volumeMounts:
    - name: shared-data
      mountPath: /usr/share/nginx/html

  - name: debian-container
    image: debian
    volumeMounts:
    - name: shared-data
      mountPath: /pod-data
    command: ["/bin/sh"]
    args: ["-c", "echo Hello from the debian container > /pod-data/index.html"]

How is /pod-data for debian container is writing under /usr/share/nginx/html ?

Tej_Singh_Rana:
Hello, @thayalan ramanathan
Because you have assigned a volume (emptyDir) which is shareable between both volume mount path.

Basavraj Nilkanthe:
Yes volume is shared between both container… Mounting to specific file directory in both container it doesnt mean they both have different data in it…