Skip to content

Commit ee018a4

Browse files
authored
Merge pull request #48051 from qlijin/volumes.md
[zh-cn] sync /docs/concepts/storage/volumes.md
2 parents 4133feb + 8089318 commit ee018a4

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

content/zh-cn/docs/concepts/storage/volumes.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,15 +2079,28 @@ FlexVolume 用户应迁移工作负载以使用对等的 CSI 驱动。
20792079

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

2097+
<!--
20832098
Mount propagation allows for sharing volumes mounted by a container to
20842099
other containers in the same pod, or even to other pods on the same node.
20852100

20862101
Mount propagation of a volume is controlled by the `mountPropagation` field
20872102
in `containers[*].volumeMounts`. Its values are:
20882103
-->
2089-
## 挂载卷的传播 {#mount-propagation}
2090-
20912104
挂载卷的传播能力允许将容器安装的卷共享到同一 Pod 中的其他容器,甚至共享到同一节点上的其他 Pod。
20922105

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

2171+
该模式的典型用例是带有 FlexVolume 或 CSI 驱动的 Pod,或者需要通过
2172+
`hostPath` 卷在主机上挂载某些东西的 Pod。
2173+
21582174
该模式等同于 [`mount(8)`](https://man7.org/linux/man-pages/man8/mount.8.html) 中描述的
21592175
`rshared` 挂载传播选项。
21602176

0 commit comments

Comments
 (0)