Share mount namespace with a privileged pod Share mount namespace with a privileged pod kubernetes kubernetes

Share mount namespace with a privileged pod


I did some research and found that kubernetes provides an option called MountPropagation which helps to achieve my requirement.

I tested this feature in my local set up and it did give me the result I wanted.

Few links that I found useful:

https://medium.com/kokster/kubernetes-mount-propagation-5306c36a4a2dhttps://kubernetes.io/docs/concepts/storage/volumes/#mount-propagation


If you really just want details of the host's mount points rather than access to them you can run your Pod with hostPID: true and then inspect the mounts of a process in the proc filesystem that you know is running in the host's mount namespace (for example PID 1) like so: cat /proc/1/mounts