1

Does containers in a Kubernetes Pod run in different "mount" namespaces? As per what i read in few online resources , when a container is launched , each container points to an isolated file system and the only thing that can be used to share file directories across containers is Kubernetes volumes. Hence, just wanted to understand, if they refer to different file systems and by default cannot refer to each others file systems, are they running in different mount namespaces?

tirtha
  • 35
  • 3

1 Answers1

1

It's right, containers can share files between each others only by using the volumes.

Assume that volume mounting is just the same as mounting network partition. So there is no conflicts with OS or namespaces (we are talking about presistent volumes).

ilyas Jumadurdyew
  • 883
  • 11
  • 24
  • Thanks, so can I consider that containers in a pod run in different mount namespaces? – tirtha Sep 19 '21 at 09:57
  • Yes IF you are using presistent volumes. – ilyas Jumadurdyew Sep 19 '21 at 10:03
  • Thanks a lot, I think Kubernetes volumes are same as Kubernetes Persistent Volumes right? I am new to Kubernetes, so these terms are bit confusing for me. – tirtha Sep 19 '21 at 10:30
  • Not exactly the same, the volume is generally what you mount to container, and PresistentVolume is one of the options that you can mount as a volume. You can also mount config map as a volume. I would suggest you to try Rancher, which make kubernetes more user friendly (rancher is the UI for kubernetes) – ilyas Jumadurdyew Sep 19 '21 at 10:40
  • Sure, thanks , I will try to dig deeper into these. – tirtha Sep 19 '21 at 13:07
  • You welcome, don't forget to vote up, and mark answer as correct if it helped you ;-) – ilyas Jumadurdyew Sep 19 '21 at 14:23