@@ -3,9 +3,7 @@ title: 持久卷
3
3
feature :
4
4
title : 存储编排
5
5
description : >
6
- 自动挂载所选存储系统,包括本地存储、诸如 <a href="https://aws.amazon.com/products/storage/">AWS</a>
7
- 或 <a href="https://cloud.google.com/storage/">GCP</a>
8
- 之类公有云提供商所提供的存储或者诸如 NFS、iSCSI、Ceph、Cinder 这类网络存储系统。
6
+ 自动挂载所选存储系统,包括本地存储、公有云提供商所提供的存储或者诸如 iSCSI 或 NFS 这类网络存储系统。
9
7
content_type : concept
10
8
weight : 20
11
9
---
@@ -20,7 +18,7 @@ title: Persistent Volumes
20
18
feature:
21
19
title: Storage orchestration
22
20
description: >
23
- Automatically mount the storage system of your choice, whether from local storage, a public cloud provider such as <a href="https://aws.amazon.com/products/storage/">AWS</a> or <a href="https://cloud.google.com/storage/">GCP</a> , or a network storage system such as NFS, iSCSI, Ceph, Cinder .
21
+ Automatically mount the storage system of your choice, whether from local storage, a public cloud provider, or a network storage system such as iSCSI or NFS .
24
22
content_type: concept
25
23
weight: 20
26
24
-->
@@ -121,7 +119,7 @@ Kubernetes API and are available for consumption.
121
119
#### 静态制备 {#static}
122
120
123
121
集群管理员创建若干 PV 卷。这些卷对象带有真实存储的细节信息,
124
- 并且对集群用户可用(可见)。PV 卷对象存在于 Kubernetes API 中,可供用户消费(使用)。
122
+ 并且对集群用户可用(可见)。PV 卷对象存在于 Kubernetes API 中,可供用户消费(使用)。
125
123
126
124
<!--
127
125
#### Dynamic
@@ -814,7 +812,7 @@ enabled for this feature to work. Refer to the
814
812
documentation for more information.
815
813
-->
816
814
Kubernetes 从 1.23 版本开始将允许用户恢复失败的 PVC 扩展这一能力作为
817
- alpha 特性支持。`RecoverVolumeExpansionFailure` 必须被启用以允许使用此特性。
815
+ Alpha 特性支持。`RecoverVolumeExpansionFailure` 必须被启用以允许使用此特性。
818
816
可参考[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
819
817
文档了解更多信息。
820
818
{{< /note >}}
@@ -828,7 +826,7 @@ value you previously tried.
828
826
This is useful if expansion to a higher value did not succeed because of capacity constraint.
829
827
If that has happened, or you suspect that it might have, you can retry expansion by specifying a
830
828
size that is within the capacity limits of underlying storage provider. You can monitor status of
831
- resize operation by watching `.status.resizeStatus ` and events on the PVC.
829
+ resize operation by watching `.status.allocatedResourceStatuses ` and events on the PVC.
832
830
-->
833
831
如果集群中的特性门控 `RecoverVolumeExpansionFailure`
834
832
已启用,在 PVC 的扩展发生失败时,你可以使用比先前请求的值更小的尺寸来重试扩展。
@@ -837,7 +835,7 @@ resize operation by watching `.status.resizeStatus` and events on the PVC.
837
835
如果由于容量限制而无法成功扩展至更高的值,这将很有用。
838
836
如果发生了这种情况,或者你怀疑可能发生了这种情况,
839
837
你可以通过指定一个在底层存储制备容量限制内的尺寸来重试扩展。
840
- 你可以通过查看 `.status.resizeStatus ` 以及 PVC 上的事件来监控调整大小操作的状态。
838
+ 你可以通过查看 `.status.allocatedResourceStatuses ` 以及 PVC 上的事件来监控调整大小操作的状态。
841
839
842
840
<!--
843
841
Note that,
@@ -863,7 +861,6 @@ PersistentVolume types are implemented as plugins. Kubernetes currently supports
863
861
PV 持久卷是用插件的形式来实现的。Kubernetes 目前支持以下插件:
864
862
865
863
<!--
866
- * [`cephfs`](/docs/concepts/storage/volumes/#cephfs) - CephFS volume
867
864
* [`csi`](/docs/concepts/storage/volumes/#csi) - Container Storage Interface (CSI)
868
865
* [`fc`](/docs/concepts/storage/volumes/#fc) - Fibre Channel (FC) storage
869
866
* [`hostPath`](/docs/concepts/storage/volumes/#hostpath) - HostPath volume
@@ -873,17 +870,14 @@ PV 持久卷是用插件的形式来实现的。Kubernetes 目前支持以下插
873
870
* [`local`](/docs/concepts/storage/volumes/#local) - local storage devices
874
871
mounted on nodes.
875
872
* [`nfs`](/docs/concepts/storage/volumes/#nfs) - Network File System (NFS) storage
876
- * [`rbd`](/docs/concepts/storage/volumes/#rbd) - Rados Block Device (RBD) volume
877
873
-->
878
- * [`cephfs`](/zh-cn/docs/concepts/storage/volumes/#cephfs) - CephFS volume
879
874
* [`csi`](/zh-cn/docs/concepts/storage/volumes/#csi) - 容器存储接口 (CSI)
880
875
* [`fc`](/zh-cn/docs/concepts/storage/volumes/#fc) - Fibre Channel (FC) 存储
881
876
* [`hostPath`](/zh-cn/docs/concepts/storage/volumes/#hostpath) - HostPath 卷
882
877
(仅供单节点测试使用;不适用于多节点集群;请尝试使用 `local` 卷作为替代)
883
878
* [`iscsi`](/zh-cn/docs/concepts/storage/volumes/#iscsi) - iSCSI (SCSI over IP) 存储
884
879
* [`local`](/zh-cn/docs/concepts/storage/volumes/#local) - 节点上挂载的本地存储设备
885
880
* [`nfs`](/zh-cn/docs/concepts/storage/volumes/#nfs) - 网络文件系统 (NFS) 存储
886
- * [`rbd`](/zh-cn/docs/concepts/storage/volumes/#rbd) - Rados 块设备 (RBD) 卷
887
881
888
882
<!--
889
883
The following types of PersistentVolume are deprecated.
@@ -899,6 +893,10 @@ This means that support is still available but will be removed in a future Kuber
899
893
(**deprecated** in v1.25)
900
894
* [`vsphereVolume`](/docs/concepts/storage/volumes/#vspherevolume) - vSphere VMDK volume
901
895
(**deprecated** in v1.19)
896
+ * [`cephfs`](/docs/concepts/storage/volumes/#cephfs) - CephFS volume
897
+ (**deprecated** in v1.28)
898
+ * [`rbd`](/docs/concepts/storage/volumes/#rbd) - Rados Block Device (RBD) volume
899
+ (**deprecated** in v1.28)
902
900
-->
903
901
以下的持久卷已被弃用。这意味着当前仍是支持的,但是 Kubernetes 将来的发行版会将其移除。
904
902
@@ -911,6 +909,10 @@ This means that support is still available but will be removed in a future Kuber
911
909
(于 v1.25 **弃用**)
912
910
* [`vsphereVolume`](/zh-cn/docs/concepts/storage/volumes/#vspherevolume) - vSphere VMDK 卷
913
911
(于 v1.19 **弃用**)
912
+ * [`cephfs`](/zh-cn/docs/concepts/storage/volumes/#cephfs) - CephFS 卷
913
+ (于 v1.28 **弃用**)
914
+ * [`rbd`](/zh-cn/docs/concepts/storage/volumes/#rbd) - Rados Block Device (RBD) 卷
915
+ (于 v1.28 **弃用**)
914
916
915
917
<!--
916
918
Older versions of Kubernetes also supported the following in-tree PersistentVolume types :
@@ -932,7 +934,6 @@ Older versions of Kubernetes also supported the following in-tree PersistentVolu
932
934
* [`storageos`](/docs/concepts/storage/volumes/#storageos) - StorageOS volume
933
935
(**not available** starting v1.25)
934
936
-->
935
-
936
937
旧版本的 Kubernetes 仍支持这些“树内(In-Tree)”持久卷类型:
937
938
938
939
* [`awsElasticBlockStore`](/zh-cn/docs/concepts/storage/volumes/#awselasticblockstore) - AWS Elastic Block Store (EBS)
@@ -1179,7 +1180,6 @@ Kubernetes 使用卷访问模式来匹配 PersistentVolumeClaim 和 PersistentVo
1179
1180
| VsphereVolume | ✓ | - | - (works when Pods are collocated) | - |
1180
1181
| PortworxVolume | ✓ | - | ✓ | - | - |
1181
1182
-->
1182
-
1183
1183
| 卷插件 | ReadWriteOnce | ReadOnlyMany | ReadWriteMany | ReadWriteOncePod |
1184
1184
| :--- | :--- : | :---: | :---: | - |
1185
1185
| AzureFile | ✓ | ✓ | ✓ | - |
@@ -1263,15 +1263,25 @@ Not all Persistent Volume types support mount options.
1263
1263
1264
1264
<!--
1265
1265
The following volume types support mount options :
1266
+
1267
+ * `azureFile`
1268
+ * `cephfs` (**deprecated** in v1.28)
1269
+ * `cinder` (**deprecated** in v1.18)
1270
+ * `gcePersistentDisk` (**deprecated** in v1.28)
1271
+ * `iscsi`
1272
+ * `nfs`
1273
+ * `rbd` (**deprecated** in v1.28)
1274
+ * `vsphereVolume`
1266
1275
-->
1267
1276
以下卷类型支持挂载选项:
1268
1277
1269
1278
* `azureFile`
1270
- * `cephfs`
1271
- * `gcePersistentDisk`
1279
+ * `cephfs`(于 v1.28 中**弃用**)
1280
+ * `cinder`(于 v1.18 中**弃用**)
1281
+ * `gcePersistentDisk`(于 v1.28 中**弃用**)
1272
1282
* `iscsi`
1273
1283
* `nfs`
1274
- * `rbd`
1284
+ * `rbd`(于 v1.28 中**弃用**)
1275
1285
* `vsphereVolume`
1276
1286
1277
1287
<!--
@@ -1321,25 +1331,67 @@ API 参考关于该字段的更多细节。
1321
1331
<!--
1322
1332
# ## Phase
1323
1333
1324
- A volume will be in one of the following phases :
1334
+ A PersistentVolume will be in one of the following phases :
1335
+
1336
+ ` Available`
1337
+ : a free resource that is not yet bound to a claim
1325
1338
1326
- * Available -- a free resource that is not yet bound to a claim
1327
- * Bound -- the volume is bound to a claim
1328
- * Released -- the claim has been deleted, but the resource is not yet reclaimed by the cluster
1329
- * Failed -- the volume has failed its automatic reclamation
1339
+ ` Bound`
1340
+ : the volume is bound to a claim
1330
1341
1331
- The CLI will show the name of the PVC bound to the PV.
1342
+ ` Released`
1343
+ : the claim has been deleted, but the associated storage resource is not yet reclaimed by the cluster
1344
+
1345
+ ` Failed`
1346
+ : the volume has failed its (automated) reclamation
1332
1347
-->
1333
1348
# ## 阶段 {#phase}
1334
1349
1335
- 每个卷会处于以下阶段(Phase)之一:
1350
+ 每个持久卷会处于以下阶段(Phase)之一:
1351
+
1352
+ ` Available`
1353
+ : 卷是一个空闲资源,尚未绑定到任何申领
1354
+
1355
+ ` Bound`
1356
+ : 该卷已经绑定到某申领
1336
1357
1337
- * Available(可用)-- 卷是一个空闲资源,尚未绑定到任何申领;
1338
- * Bound(已绑定)-- 该卷已经绑定到某申领;
1339
- * Released(已释放)-- 所绑定的申领已被删除,但是资源尚未被集群回收;
1340
- * Failed(失败)-- 卷的自动回收操作失败。
1358
+ ` Released`
1359
+ : 所绑定的申领已被删除,但是关联存储资源尚未被集群回收
1341
1360
1342
- 命令行接口能够显示绑定到某 PV 卷的 PVC 对象。
1361
+ ` Failed`
1362
+ : 卷的自动回收操作失败
1363
+
1364
+ <!--
1365
+ You can see the name of the PVC bound to the PV using `kubectl describe persistentvolume <name>`.
1366
+ -->
1367
+ 你可以使用 `kubectl describe persistentvolume <name>` 查看已绑定到 PV 的 PVC 的名称。
1368
+
1369
+ <!--
1370
+ # ### Phase transition timestamp
1371
+ -->
1372
+ # ### 阶段转换时间戳
1373
+
1374
+ {{< feature-state for_k8s_version="v1.28" state="alpha" >}}
1375
+
1376
+ <!--
1377
+ The `.status` field for a PersistentVolume can include an alpha `lastPhaseTransitionTime` field. This field records
1378
+ the timestamp of when the volume last transitioned its phase. For newly created
1379
+ volumes the phase is set to `Pending` and `lastPhaseTransitionTime` is set to
1380
+ the current time.
1381
+ -->
1382
+ 持久卷的 `.status` 字段可以包含 Alpha 状态的 `lastPhaseTransitionTime` 字段。
1383
+ 该字段保存的是卷上次转换阶段的时间戳。
1384
+ 对于新创建的卷,阶段被设置为 `Pending`,`lastPhaseTransitionTime` 被设置为当前时间。
1385
+
1386
+ {{< note >}}
1387
+ <!--
1388
+ You need to enable the `PersistentVolumeLastPhaseTransitionTime` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
1389
+ to use or see the `lastPhaseTransitionTime` field.
1390
+ -->
1391
+ 你需要启用 `PersistentVolumeLastPhaseTransitionTime`
1392
+ [特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)以使用或查看
1393
+ ` lastPhaseTransitionTime` 字段。
1394
+ {{< /note >}}
1343
1395
1344
1396
# # PersistentVolumeClaims
1345
1397
@@ -1403,8 +1455,7 @@ applies to both volumes and claims.
1403
1455
# ## 资源 {#resources}
1404
1456
1405
1457
申领和 Pod 一样,也可以请求特定数量的资源。在这个上下文中,请求的资源是存储。
1406
- 卷和申领都使用相同的
1407
- [资源模型](https://git.k8s.io/design-proposals-archive/scheduling/resources.md)。
1458
+ 卷和申领都使用相同的[资源模型](https://git.k8s.io/design-proposals-archive/scheduling/resources.md)。
1408
1459
1409
1460
<!--
1410
1461
# ## Selector
@@ -1475,9 +1526,9 @@ PV 卷(未设置注解或者注解值为 `""` 的 PersistentVolume(PV)对
1475
1526
PVs of that default. Specifying a default StorageClass is done by setting the
1476
1527
annotation `storageclass.kubernetes.io/is-default-class` equal to `true` in
1477
1528
a StorageClass object. If the administrator does not specify a default, the
1478
- cluster responds to PVC creation as if the admission plugin were turned off. If
1479
- more than one default is specified, the admission plugin forbids the creation of
1480
- all PVCs .
1529
+ cluster responds to PVC creation as if the admission plugin were turned off. If more than one
1530
+ default StorageClass is specified, the newest default is used when the
1531
+ PVC is dynamically provisioned .
1481
1532
* If the admission plugin is turned off, there is no notion of a default
1482
1533
StorageClass. All PVCs that have `storageClassName` set to `""` can be
1483
1534
bound only to PVs that have `storageClassName` also set to `""`.
@@ -1490,7 +1541,7 @@ PV 卷(未设置注解或者注解值为 `""` 的 PersistentVolume(PV)对
1490
1541
设置默认 StorageClass 的工作是通过将对应 StorageClass 对象的注解
1491
1542
` storageclass.kubernetes.io/is-default-class` 赋值为 `true` 来完成的。
1492
1543
如果管理员未设置默认存储类,集群对 PVC 创建的处理方式与未启用准入控制器插件时相同。
1493
- 如果设定的默认存储类不止一个,准入控制插件会禁止所有创建 PVC 操作 。
1544
+ 如果设定的默认存储类不止一个,当 PVC 被动态制备时将使用最新的默认存储类 。
1494
1545
* 如果准入控制器插件被关闭,则不存在默认 StorageClass 的说法。
1495
1546
所有将 `storageClassName` 设为 `""` 的 PVC 只能被绑定到也将 `storageClassName` 设为 `""` 的 PV。
1496
1547
不过,只要默认的 StorageClass 可用,就可以稍后更新缺少 `storageClassName` 的 PVC。
@@ -1536,7 +1587,7 @@ it won't be supported in a future Kubernetes release.
1536
1587
-->
1537
1588
# ### 可追溯的默认 StorageClass 赋值 {#retroactive-default-storageclass-assignment}
1538
1589
1539
- {{< feature-state for_k8s_version="v1.26 " state="beta " >}}
1590
+ {{< feature-state for_k8s_version="v1.28 " state="stable " >}}
1540
1591
1541
1592
<!--
1542
1593
You can create a PersistentVolumeClaim without specifying a `storageClassName`
@@ -1654,18 +1705,22 @@ applicable:
1654
1705
<!--
1655
1706
* CSI
1656
1707
* FC (Fibre Channel)
1657
- * GCEPersistentDisk
1708
+ * GCEPersistentDisk (deprecated)
1658
1709
* iSCSI
1659
1710
* Local volume
1660
- * RBD (Ceph Block Device)
1711
+ * OpenStack Cinder
1712
+ * RBD (deprecated)
1713
+ * RBD (Ceph Block Device; deprecated)
1661
1714
* VsphereVolume
1662
1715
-->
1663
1716
* CSI
1664
1717
* FC(光纤通道)
1665
- * GCEPersistentDisk
1718
+ * GCEPersistentDisk(已弃用)
1666
1719
* iSCSI
1667
1720
* Local 卷
1668
- * RBD(Ceph 块设备)
1721
+ * OpenStack Cinder
1722
+ * RBD(已弃用)
1723
+ * RBD(Ceph 块设备,已弃用)
1669
1724
* VsphereVolume
1670
1725
1671
1726
<!--
0 commit comments