apiVersion: v1
kind: Pod
metadata:
  name: data-exchange
spec:
  containers:
  - image: busybox
    name: main-app
    command: ['sh', '-c', 'counter=1; while true; do touch "/var/app/data/$counter-data.txt"; counter=$((counter+1)); sleep 30; done']
    volumeMounts:
    - name: data-dir
      mountPath: "/var/app/data"
    resources: {}
  - image: busybox
    name: sidecar
    command: ['sh', '-c', 'while true; do ls -d /var/app/data/*-data.txt | wc -l; sleep 30; done']
    volumeMounts:
    - name: data-dir
      mountPath: "/var/app/data"
  volumes:
  - name: data-dir
    emptyDir: {}
  dnsPolicy: ClusterFirst
  restartPolicy: Never
status: {}