Skip to content

Commit

Permalink
Merge pull request #48051 from qlijin/volumes.md
Browse files Browse the repository at this point in the history
[zh-cn] sync /docs/concepts/storage/volumes.md
  • Loading branch information
k8s-ci-robot authored Sep 24, 2024
2 parents 4133feb + 8089318 commit ee018a4
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions content/zh-cn/docs/concepts/storage/volumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2079,15 +2079,28 @@ FlexVolume 用户应迁移工作负载以使用对等的 CSI 驱动。

<!--
## Mount propagation
-->
## 挂载卷的传播 {#mount-propagation}

{{< caution >}}
<!--
Mount propagation is a low-level feature that does not work consistently on all
volume types. It is recommended to use only with `hostPath` or in-memory `emptyDir`
volumes. See [this discussion](https://github.com/kubernetes/kubernetes/issues/95049)
for more context.
-->
挂载卷的传播是一项底层功能,不能在所有类型的卷中以一致的方式工作。
建议只在 `hostPath` 或基于内存的 `emptyDir` 卷中使用。
详情请参考[讨论](https://github.com/kubernetes/kubernetes/issues/95049)。
{{< /caution >}}

<!--
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.

Mount propagation of a volume is controlled by the `mountPropagation` field
in `containers[*].volumeMounts`. Its values are:
-->
## 挂载卷的传播 {#mount-propagation}

挂载卷的传播能力允许将容器安装的卷共享到同一 Pod 中的其他容器,甚至共享到同一节点上的其他 Pod。

卷的挂载传播特性由 `containers[*].volumeMounts` 中的 `mountPropagation` 字段控制。
Expand Down Expand Up @@ -2155,6 +2168,9 @@ in `containers[*].volumeMounts`. Its values are:
* `Bidirectional` - 这种卷挂载和 `HostToContainer` 挂载表现相同。
另外,容器创建的卷挂载将被传播回至主机和使用同一卷的所有 Pod 的所有容器。

该模式的典型用例是带有 FlexVolume 或 CSI 驱动的 Pod,或者需要通过
`hostPath` 卷在主机上挂载某些东西的 Pod。

该模式等同于 [`mount(8)`](https://man7.org/linux/man-pages/man8/mount.8.html) 中描述的
`rshared` 挂载传播选项。

Expand Down

0 comments on commit ee018a4

Please sign in to comment.