From d623f631fda2277b193731d3765f981c69c45d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0afr=C3=A1nek?= Date: Thu, 26 Apr 2018 21:23:26 +0200 Subject: [PATCH] Add documentation about private mount propagation (#8106) * Trivial change to open release branch * Undo trivial change * Add documentation about private mount propagation --- docs/concepts/storage/volumes.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/concepts/storage/volumes.md b/docs/concepts/storage/volumes.md index 0e561c309a..a9b36d8c28 100644 --- a/docs/concepts/storage/volumes.md +++ b/docs/concepts/storage/volumes.md @@ -1076,16 +1076,24 @@ More details can be found [here](https://github.com/kubernetes/community/blob/ma Mount propagation allows for sharing volumes mounted by a Container to other Containers in the same Pod, or even to other Pods on the same node. -If the "`MountPropagation`" feature is disabled, volume mounts in pods are not propagated. -That is, Containers run with `private` mount propagation as described in the -[Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). +If the "`MountPropagation`" feature is disabled or a Pod does not explicitly +specify specific mount propagation, volume mounts in the Pod's Containers are +not propagated. That is, Containers run with `private` mount propagation as +described in the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). Mount propagation of a volume is controlled by `mountPropagation` field in Container.volumeMounts. Its values are: + * `None` - This volume mount will not receive any subsequent mounts + that are mounted to this volume or any of its subdirectories by the host. + In similar fashion, no mounts created by the Container will be visible on + the host. This is the default mode. + + This mode is equal to `private` mount propagation as described in the + [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + * `HostToContainer` - This volume mount will receive all subsequent mounts - that are mounted to this volume or any of its subdirectories. This is - the default mode. + that are mounted to this volume or any of its subdirectories. In other words, if the host mounts anything inside the volume mount, the Container will see it mounted there. @@ -1101,7 +1109,7 @@ Its values are: In addition, all volume mounts created by the Container will be propagated back to the host and to all Containers of all Pods that use the same volume. - A typical use case for this mode is a Pod with a `FlexVolume` driver or + A typical use case for this mode is a Pod with a `FlexVolume` or `CSI` driver or a Pod that needs to mount something on the host using a `hostPath` volume. This mode is equal to `rshared` mount propagation as described in the