@@ -27,10 +27,13 @@ weight: 20
27
27
28
28
<!--
29
29
This document describes _persistent volumes_ in Kubernetes. Familiarity with
30
- [volumes](/docs/concepts/storage/volumes/) is suggested.
30
+ [volumes](/docs/concepts/storage/volumes/), [StorageClasses](/docs/concepts/storage/storage-classes/)
31
+ and [VolumeAttributesClasses](/docs/concepts/storage/volume-attributes-classes/) is suggested.
31
32
-->
32
- 本文描述 Kubernetes 中的** 持久卷(Persistent Volume)** 。
33
- 建议先熟悉[ 卷(Volume)] ( /zh-cn/docs/concepts/storage/volumes/ ) 的概念。
33
+ 本文描述 Kubernetes 中的** 持久卷(Persistent Volumes)** 。
34
+ 建议先熟悉[ 卷(volume)] ( /zh-ch/docs/concepts/storage/volumes/ ) 、
35
+ [ 存储类(StorageClass)] ( /zh-cn/docs/concepts/storage/storage-classes/ ) 和
36
+ [ 卷属性类(VolumeAttributesClass)] ( /zh-cn/docs/concepts/storage/volume-attributes-classes/ ) 。
34
37
35
38
<!-- body -->
36
39
@@ -63,14 +66,14 @@ A _PersistentVolume_ (PV) is a piece of storage in the cluster that has been pro
63
66
A _PersistentVolumeClaim_ (PVC) is a request for storage by a user. It is similar
64
67
to a Pod. Pods consume node resources and PVCs consume PV resources. Pods can
65
68
request specific levels of resources (CPU and Memory). Claims can request specific
66
- size and access modes (e.g., they can be mounted ReadWriteOnce, ReadOnlyMany or
67
- ReadWriteMany, see [AccessModes](#access-modes)).
69
+ size and access modes (e.g., they can be mounted ReadWriteOnce, ReadOnlyMany,
70
+ ReadWriteMany, or ReadWriteOncePod, see [AccessModes](#access-modes)).
68
71
-->
69
72
** 持久卷申领(PersistentVolumeClaim,PVC)** 表达的是用户对存储的请求。概念上与 Pod 类似。
70
73
Pod 会耗用节点资源,而 PVC 申领会耗用 PV 资源。Pod 可以请求特定数量的资源(CPU
71
- 和内存); 同样 PVC 申领也可以请求特定的大小和访问模式
72
- (例如,可以要求 PV 卷能够以 ReadWriteOnce、ReadOnlyMany 或 ReadWriteMany
73
- 模式之一来挂载,参见 [ 访问模式] ( #access-modes ) )。
74
+ 和内存)。 同样 PVC 申领也可以请求特定的大小和访问模式
75
+ (例如,可以挂载为 ReadWriteOnce、ReadOnlyMany、ReadWriteMany 或 ReadWriteOncePod,
76
+ 请参阅 [ 访问模式] ( #access-modes ) )。
74
77
75
78
<!--
76
79
While PersistentVolumeClaims allow a user to consume abstract storage resources,
@@ -982,19 +985,16 @@ mounting of NFS filesystems.
982
985
# ## Capacity
983
986
984
987
Generally, a PV will have a specific storage capacity. This is set using the PV's
985
- ` capacity` attribute. Read the glossary term
986
- [Quantity](/docs/reference/glossary/?all=true#term-quantity) to understand the units
987
- expected by `capacity`.
988
+ ` capacity` attribute which is a {{< glossary_tooltip term_id="quantity" >}} value.
988
989
989
990
Currently, storage size is the only resource that can be set or requested.
990
991
Future attributes may include IOPS, throughput, etc.
991
992
-->
992
993
# ## 容量 {#capacity}
993
994
994
995
一般而言,每个 PV 卷都有确定的存储容量。
995
- 容量属性是使用 PV 对象的 `capacity` 属性来设置的。
996
- 参考词汇表中的[量纲(Quantity)](/zh-cn/docs/reference/glossary/?all=true#term-quantity)
997
- 词条,了解 `capacity` 字段可以接受的单位。
996
+ 这是通过 PV 的 `capacity` 属性设置的,
997
+ 该属性是一个{{< glossary_tooltip text="量纲(Quantity)" term_id="quantity" >}}。
998
998
999
999
目前,存储大小是可以设置和请求的唯一资源。
1000
1000
未来可能会包含 IOPS、吞吐量等属性。
@@ -1062,7 +1062,8 @@ The access modes are:
1062
1062
1063
1063
` ReadWriteOnce`
1064
1064
: the volume can be mounted as read-write by a single node. ReadWriteOnce access
1065
- mode still can allow multiple pods to access the volume when the pods are running on the same node.
1065
+ mode still can allow multiple pods to access the volume when the pods are
1066
+ running on the same node. For single pod access, please see ReadWriteOncePod.
1066
1067
1067
1068
` ReadOnlyMany`
1068
1069
: the volume can be mounted as read-only by many nodes.
@@ -1071,21 +1072,17 @@ The access modes are:
1071
1072
: the volume can be mounted as read-write by many nodes.
1072
1073
1073
1074
` ReadWriteOncePod`
1074
- : {{< feature-state for_k8s_version="v1.27 " state="beta " >}}
1075
+ : {{< feature-state for_k8s_version="v1.29 " state="stable " >}}
1075
1076
the volume can be mounted as read-write by a single Pod. Use ReadWriteOncePod
1076
1077
access mode if you want to ensure that only one pod across whole cluster can
1077
- read that PVC or write to it. This is only supported for CSI volumes and
1078
- Kubernetes version 1.22+.
1079
-
1080
- The blog article
1081
- [Introducing Single Pod Access Mode for PersistentVolumes](/blog/2021/09/13/read-write-once-pod-access-mode-alpha/)
1082
- covers this in more detail.
1078
+ read that PVC or write to it.
1083
1079
-->
1084
1080
访问模式有:
1085
1081
1086
1082
` ReadWriteOnce`
1087
1083
: 卷可以被一个节点以读写方式挂载。
1088
- ReadWriteOnce 访问模式也允许运行在同一节点上的多个 Pod 访问卷。
1084
+ ReadWriteOnce 访问模式仍然可以在同一节点上运行的多个 Pod 访问该卷。
1085
+ 对于单个 Pod 的访问,请参考 ReadWriteOncePod 访问模式。
1089
1086
1090
1087
` ReadOnlyMany`
1091
1088
: 卷可以被多个节点以只读方式挂载。
@@ -1094,13 +1091,32 @@ covers this in more detail.
1094
1091
: 卷可以被多个节点以读写方式挂载。
1095
1092
1096
1093
` ReadWriteOncePod`
1097
- : {{< feature-state for_k8s_version="v1.27 " state="beta " >}}
1094
+ : {{< feature-state for_k8s_version="v1.29 " state="stable " >}}
1098
1095
卷可以被单个 Pod 以读写方式挂载。
1099
1096
如果你想确保整个集群中只有一个 Pod 可以读取或写入该 PVC,
1100
- 请使用 ReadWriteOncePod 访问模式。这只支持 CSI 卷以及需要 Kubernetes 1.22 以上版本。
1097
+ 请使用 ReadWriteOncePod 访问模式。
1098
+
1099
+ {{< note >}}
1100
+ <!--
1101
+ The `ReadWriteOncePod` access mode is only supported for
1102
+ {{< glossary_tooltip text="CSI" term_id="csi" >}} volumes and Kubernetes version
1103
+ 1.22+. To use this feature you will need to update the following
1104
+ [CSI sidecars](https://kubernetes-csi.github.io/docs/sidecar-containers.html)
1105
+ to these versions or greater :
1101
1106
1102
- 这篇博客文章 [Introducing Single Pod Access Mode for PersistentVolumes](/blog/2021/09/13/read-write-once-pod-access-mode-alpha/)
1103
- 描述了更详细的内容。
1107
+ * [csi-provisioner:v3.0.0+](https://github.com/kubernetes-csi/external-provisioner/releases/tag/v3.0.0)
1108
+ * [csi-attacher:v3.3.0+](https://github.com/kubernetes-csi/external-attacher/releases/tag/v3.3.0)
1109
+ * [csi-resizer:v1.3.0+](https://github.com/kubernetes-csi/external-resizer/releases/tag/v1.3.0)
1110
+ -->
1111
+
1112
+ ` ReadWriteOncePod` 访问模式仅适用于 {{< glossary_tooltip text="CSI" term_id="csi" >}} 卷和 Kubernetes v1.22+。
1113
+ 要使用此特性,你需要将以下
1114
+ [CSI 边车](https://kubernetes-csi.github.io/docs/sidecar-containers.html)更新为下列或更高版本:
1115
+
1116
+ - [csi-provisioner:v3.0.0+](https://github.com/kubernetes-csi/external-provisioner/releases/tag/v3.0.0)
1117
+ - [csi-attacher:v3.3.0+](https://github.com/kubernetes-csi/external-attacher/releases/tag/v3.3.0)
1118
+ - [csi-resizer:v1.3.0+](https://github.com/kubernetes-csi/external-resizer/releases/tag/v1.3.0)
1119
+ {{< /note >}}
1104
1120
1105
1121
<!--
1106
1122
In the CLI, the access modes are abbreviated to :
@@ -1205,7 +1221,7 @@ Current reclaim policies are:
1205
1221
1206
1222
* Retain -- manual reclamation
1207
1223
* Recycle -- basic scrub (`rm -rf /thevolume/*`)
1208
- * Delete -- associated storage asset
1224
+ * Delete -- delete the volume
1209
1225
1210
1226
For Kubernetes {{< skew currentVersion >}}, only `nfs` and `hostPath` volume types support recycling.
1211
1227
-->
@@ -1215,7 +1231,7 @@ For Kubernetes {{< skew currentVersion >}}, only `nfs` and `hostPath` volume typ
1215
1231
1216
1232
* Retain -- 手动回收
1217
1233
* Recycle -- 简单擦除 (`rm -rf /thevolume/*`)
1218
- * Delete -- 删除关联存储资产
1234
+ * Delete -- 删除存储卷
1219
1235
1220
1236
对于 Kubernetes {{< skew currentVersion >}} 来说,只有
1221
1237
` nfs` 和 `hostPath` 卷类型支持回收(Recycle)。
@@ -1344,7 +1360,7 @@ You can see the name of the PVC bound to the PV using `kubectl describe persiste
1344
1360
-->
1345
1361
# ### 阶段转换时间戳
1346
1362
1347
- {{< feature-state for_k8s_version="v1.28 " state="alpha " >}}
1363
+ {{< feature-state for_k8s_version="v1.29 " state="beta " >}}
1348
1364
1349
1365
<!--
1350
1366
The `.status` field for a PersistentVolume can include an alpha `lastPhaseTransitionTime` field. This field records
0 commit comments