apiVersion: v1
kind: Pod
metadata:
  namespace: default
  name: my-pod
  labels:
    app: my-pod
spec:
  terminationGracePeriodSeconds: 0
  initContainers:
    - name: my-init-container-01
      image: busybox:1.31.1
      command: ["/bin/sh"]
      args: ["-c", "echo $(date) my-init-container-01 >> /shared/file"]
      volumeMounts: 
        - name: my-volume
          mountPath: /shared
    - name: my-init-container-02
      image: busybox:1.31.1
      command: ["/bin/sh"]
      args: ["-c", "echo $(date) my-init-container-02 >> /shared/file"]
      volumeMounts: 
        - name: my-volume
          mountPath: /shared
    - name: my-init-container-03
      image: busybox:1.31.1
      command: ["/bin/sh"]
      args: ["-c", "echo $(date) my-init-container-03 >> /shared/file"]
      volumeMounts: 
        - name: my-volume
          mountPath: /shared
  containers:
    - name: my-container-01
      image: busybox:1.31.1
      command: ["/bin/sh"]
      args: ["-c", "while true; do echo $(date) my-container-01 >> /shared/file; sleep 10; done"]
      volumeMounts: 
        - name: my-volume
          mountPath: /shared
    - name: my-container-02
      image: busybox:1.31.1
      command: ["/bin/sh"]
      args: ["-c", "while true; do echo $(date) my-container-02 >> /shared/file; sleep 10; done"]
      volumeMounts: 
        - name: my-volume
          mountPath: /shared
    - name: my-container-03
      image: busybox:1.31.1
      command: ["/bin/sh"]
      args: ["-c", "while true; do echo $(date) my-container-03 >> /shared/file; sleep 10; done"]
      volumeMounts: 
        - name: my-volume
          mountPath: /shared                    
  volumes:
    - name: my-volume
      emptyDir: {}
          
