apiVersion: v1
kind: Pod
metadata:
  labels:
    run: multi-container-playground
  name: multi-container-playground
spec:
  volumes:
  - name: shared-data
    emptyDir: {}

  containers:

  - name: c1
    image: nginx:1.17.6-alpine
    env:
    - name: MY_NODE_NAME                                                          
      valueFrom:                                                                  
        fieldRef:                                                                 
          fieldPath: spec.nodeName
    volumeMounts:
    - name: shared-data
      mountPath: /shared-volume

  - name: c2
    image: busybox:1.31.1
    volumeMounts:
    - name: shared-data
      mountPath: /shared-volume
    command: ["sh", "-c", "while true; do date >> /shared-volume/date.log; sleep 1; done"]
  
  - name: c3
    image: busybox:1.31.1
    volumeMounts:
    - name: shared-data
      mountPath: /shared-volume
    command: ["sh", "-c", "tail -f /shared-volume/date.log"]