diff --git a/content/zh-cn/docs/concepts/storage/volumes.md b/content/zh-cn/docs/concepts/storage/volumes.md index fe1d246a1f..eebecc18b5 100644 --- a/content/zh-cn/docs/concepts/storage/volumes.md +++ b/content/zh-cn/docs/concepts/storage/volumes.md @@ -443,18 +443,10 @@ overlays), the `emptyDir` may run out of capacity before this limit. 如果来自其他来源(如日志文件或镜像分层数据)的数据占满了存储,`emptyDir` 可能会在达到此限制之前发生存储容量不足的问题。 -{{< note >}} -你可以指定内存作为介质的卷的大小,前提是集群中启用了 `SizeMemoryBackedVolumes` -[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/) -(自 Kubernetes 1.22 发布以来,此特性一直处于 Beta 阶段,并且默认启用)。 -如果你未指定大小,内存作为介质的卷的大小根据节点可分配内存进行调整。 -{{< /note>}} +如果未指定大小,内存支持的卷将被设置为节点可分配内存的大小。 {{< caution >}} +#### emptyDir 内存配置示例 + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: test-pd +spec: + containers: + - image: registry.k8s.io/test-webserver + name: test-container + volumeMounts: + - mountPath: /cache + name: cache-volume + volumes: + - name: cache-volume + emptyDir: + sizeLimit: 500Mi + medium: Memory +``` + -[容器存储接口](https://github.com/container-storage-interface/spec/blob/master/spec.md) (CSI) +[容器存储接口](https://github.com/container-storage-interface/spec/blob/master/spec.md)(CSI) 为容器编排系统(如 Kubernetes)定义标准接口,以将任意存储系统暴露给它们的容器工作负载。 -下面的 FlexVolume [插件](https://github.com/Microsoft/K8s-Storage-Plugins/tree/master/flexvolume/windows) -以 PowerShell 脚本的形式部署在宿主机系统上,支持 Windows 节点: +下面的 FlexVolume +[插件](https://github.com/Microsoft/K8s-Storage-Plugins/tree/master/flexvolume/windows)以 +PowerShell 脚本的形式部署在宿主机系统上,支持 Windows 节点: * [SMB](https://github.com/microsoft/K8s-Storage-Plugins/tree/master/flexvolume/windows/plugins/microsoft.com~smb.cmd) * [iSCSI](https://github.com/microsoft/K8s-Storage-Plugins/tree/master/flexvolume/windows/plugins/microsoft.com~iscsi.cmd) @@ -2190,12 +2207,12 @@ FlexVolume 用户应迁移工作负载以使用对等的 CSI 驱动。 ## 挂载卷的传播 {#mount-propagation} {{< caution >}} - + --> 挂载卷的传播是一项底层功能,不能在所有类型的卷中以一致的方式工作。 建议只在 `hostPath` 或基于内存的 `emptyDir` 卷中使用。 详情请参考[讨论](https://github.com/kubernetes/kubernetes/issues/95049)。 @@ -2235,7 +2252,7 @@ in `containers[*].volumeMounts`. Its values are: 然而,当 `rprivate` 传播选项不适用时,CRI 运行时可以转为选择 `rslave` 挂载传播选项 (即 `HostToContainer`)。当挂载源包含 Docker 守护进程的根目录(`/var/lib/docker`)时, - cri-dockerd (Docker) 已知可以选择 `rslave` 挂载传播选项。 + cri-dockerd(Docker)已知可以选择 `rslave` 挂载传播选项。 ```yaml apiVersion: v1 kind: Service @@ -436,19 +489,20 @@ the StatefulSet. --> ### Pod 索引标签 {#pod-index-label} -{{< feature-state for_k8s_version="v1.28" state="beta" >}} +{{< feature-state feature_gate_name="PodIndexLabel" >}} 当 StatefulSet {{}}创建一个 Pod 时, 新的 Pod 会被打上 `apps.kubernetes.io/pod-index` 标签。标签的取值为 Pod 的序号索引。 此标签使你能够将流量路由到特定索引值的 Pod、使用 Pod 索引标签来过滤日志或度量值等等。 -注意要使用这一特性需要启用特性门控 `PodIndexLabel`,而该门控默认是被启用的。 +请注意,默认情况下,特性门 `PodIndexLabel` 已启用并锁定。要禁用它, +用户需要使用服务器模拟版本 v1.31。 ## PersistentVolumeClaim 保留 {#persistentvolumeclaim-retention} -{{< feature-state for_k8s_version="v1.27" state="beta" >}} +{{< feature-state feature_gate_name="StatefulSetAutoDeletePVC" >}}