I am trying to create and delete file from the same pod and get error that the file not found, any idea?
one container creates the file and the second should delete it...
apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
volumes:
- name: shared
emptyDir: { }
containers:
- name: createfile
image: debian
command: [ "/bin/sh", "-c" ]
args:
- while true; do
touch /usr/test.txt;
ls
echo "new file created on container";
sleep 30;
done
volumeMounts:
- name: shared
mountPath: /usr/
- name: deletefile
image: debian
volumeMounts:
- name: shared
mountPath: /usr/
command: [ "/bin/sh", "-c" ]
args:
- while true; do
rm /usr/test.txt;
ls
echo "container 2 - file removed";
sleep 30;
done
The error which I got is:
ls: error while loading shared libraries: libpcre2-8.so.0: cannot open shared object file: No such file or directory
Is it because I am running ls in the container, any idea why? As I use Debian, not sure what is the issue