apiVersion: apps/v1
kind: Deployment
metadata:
  name: two-containers
spec:
  template:
    spec:
      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 > /pod-data/index.html"]
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: another-two-containers
spec:
  template:
    spec:
      containers:
      - name: nginx-container
        image: nginx
      - name: debian-container
        image: debian
        command: ["/bin/sh"]
        args: ["-c", "echo Hello"]
