We have scenario where we are building the image Dockerfile where inside Dockerfile we are copying the local folder into the image one is code folder and another is product folder /apps/pub/crx-quickstart and this path is mounted with local storage. when i am creating a POD inside kubernetes cluster inside mount path /apps/pub/crx-quickstart no files and folder and it is showing lost+found directory.
I am struggling from last 3 days and unable to solve it. Please help
I’m afraid that it’s normal behavior. If you mount something to the path the original content will be hidden. There is nothing to merge your data from the docker image with the data on the volume. Do you try mounting it as a sub-dir of /apps/pub/crx-quickstart?
It looks correct for me. You mount the empty,100Gi volume to /apps/publisher/crx-quickstart. If you have some files there they are “covered” by this mount.
But it is not happening inside the container when i am going and doing ls -ltr only one directory lost+found is present. even though inside the container it has mounted well
You need to copy data into the volume. Whatever path you mount it on will be hidden inside your running container, regardless of whether your image has data there. Docker tries to be clever and copy files there, but Kubernetes does not - too many edge cases. You made a volume, you have to initialize it. Only you know what that really means for your app.
In our scenario the data in the volume is initialized by an entrypoint script. However, an empty directory where the data is initialized does exist before initialization happens. When we scale down the StatefulSet and then scale it back up the data is gone.