I am on the chapter 4 - questions 7 to 10. I have the below manifest.
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: {}
ls: /var/app/data/*-data.txt: No such file or directory
ls: : No such file or directory
0
ls: /var/app/data/*-data.txt: No such file or directory
ls: : No such file or directory
0
touch: /var/app/data/463608-data.txt: No such file or directory
sh: sleep: not found
touch: /var/app/data/463609-data.txt: No such file or directory
sh: sleep: not found
touch: /var/app/data/463610-data.txt: No such file or directory
sh: sleep: not found