Skip to content

Commit 2cc2460

Browse files
authored
Merge pull request #42561 from windsonsea/pvcy
[zh] sync persistent-volumes.md
2 parents 6be64fc + d3f0ae8 commit 2cc2460

File tree

1 file changed

+95
-40
lines changed

1 file changed

+95
-40
lines changed

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

Lines changed: 95 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: 持久卷
33
feature:
44
title: 存储编排
55
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 这类网络存储系统。
97
content_type: concept
108
weight: 20
119
---
@@ -20,7 +18,7 @@ title: Persistent Volumes
2018
feature:
2119
title: Storage orchestration
2220
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.
2422
content_type: concept
2523
weight: 20
2624
-->
@@ -121,7 +119,7 @@ Kubernetes API and are available for consumption.
121119
#### 静态制备 {#static}
122120

123121
集群管理员创建若干 PV 卷。这些卷对象带有真实存储的细节信息,
124-
并且对集群用户可用(可见)。PV 卷对象存在于 Kubernetes API 中,可供用户消费(使用)。
122+
并且对集群用户可用(可见)。PV 卷对象存在于 Kubernetes API 中,可供用户消费(使用)。
125123

126124
<!--
127125
#### Dynamic
@@ -814,7 +812,7 @@ enabled for this feature to work. Refer to the
814812
documentation for more information.
815813
-->
816814
Kubernetes 从 1.23 版本开始将允许用户恢复失败的 PVC 扩展这一能力作为
817-
alpha 特性支持。`RecoverVolumeExpansionFailure` 必须被启用以允许使用此特性。
815+
Alpha 特性支持。`RecoverVolumeExpansionFailure` 必须被启用以允许使用此特性。
818816
可参考[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
819817
文档了解更多信息。
820818
{{< /note >}}
@@ -828,7 +826,7 @@ value you previously tried.
828826
This is useful if expansion to a higher value did not succeed because of capacity constraint.
829827
If that has happened, or you suspect that it might have, you can retry expansion by specifying a
830828
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.
832830
-->
833831
如果集群中的特性门控 `RecoverVolumeExpansionFailure`
834832
已启用,在 PVC 的扩展发生失败时,你可以使用比先前请求的值更小的尺寸来重试扩展。
@@ -837,7 +835,7 @@ resize operation by watching `.status.resizeStatus` and events on the PVC.
837835
如果由于容量限制而无法成功扩展至更高的值,这将很有用。
838836
如果发生了这种情况,或者你怀疑可能发生了这种情况,
839837
你可以通过指定一个在底层存储制备容量限制内的尺寸来重试扩展。
840-
你可以通过查看 `.status.resizeStatus` 以及 PVC 上的事件来监控调整大小操作的状态。
838+
你可以通过查看 `.status.allocatedResourceStatuses` 以及 PVC 上的事件来监控调整大小操作的状态。
841839

842840
<!--
843841
Note that,
@@ -863,7 +861,6 @@ PersistentVolume types are implemented as plugins. Kubernetes currently supports
863861
PV 持久卷是用插件的形式来实现的。Kubernetes 目前支持以下插件:
864862

865863
<!--
866-
* [`cephfs`](/docs/concepts/storage/volumes/#cephfs) - CephFS volume
867864
* [`csi`](/docs/concepts/storage/volumes/#csi) - Container Storage Interface (CSI)
868865
* [`fc`](/docs/concepts/storage/volumes/#fc) - Fibre Channel (FC) storage
869866
* [`hostPath`](/docs/concepts/storage/volumes/#hostpath) - HostPath volume
@@ -873,17 +870,14 @@ PV 持久卷是用插件的形式来实现的。Kubernetes 目前支持以下插
873870
* [`local`](/docs/concepts/storage/volumes/#local) - local storage devices
874871
mounted on nodes.
875872
* [`nfs`](/docs/concepts/storage/volumes/#nfs) - Network File System (NFS) storage
876-
* [`rbd`](/docs/concepts/storage/volumes/#rbd) - Rados Block Device (RBD) volume
877873
-->
878-
* [`cephfs`](/zh-cn/docs/concepts/storage/volumes/#cephfs) - CephFS volume
879874
* [`csi`](/zh-cn/docs/concepts/storage/volumes/#csi) - 容器存储接口 (CSI)
880875
* [`fc`](/zh-cn/docs/concepts/storage/volumes/#fc) - Fibre Channel (FC) 存储
881876
* [`hostPath`](/zh-cn/docs/concepts/storage/volumes/#hostpath) - HostPath 卷
882877
(仅供单节点测试使用;不适用于多节点集群;请尝试使用 `local` 卷作为替代)
883878
* [`iscsi`](/zh-cn/docs/concepts/storage/volumes/#iscsi) - iSCSI (SCSI over IP) 存储
884879
* [`local`](/zh-cn/docs/concepts/storage/volumes/#local) - 节点上挂载的本地存储设备
885880
* [`nfs`](/zh-cn/docs/concepts/storage/volumes/#nfs) - 网络文件系统 (NFS) 存储
886-
* [`rbd`](/zh-cn/docs/concepts/storage/volumes/#rbd) - Rados 块设备 (RBD) 卷
887881

888882
<!--
889883
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
899893
(**deprecated** in v1.25)
900894
* [`vsphereVolume`](/docs/concepts/storage/volumes/#vspherevolume) - vSphere VMDK volume
901895
(**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)
902900
-->
903901
以下的持久卷已被弃用。这意味着当前仍是支持的,但是 Kubernetes 将来的发行版会将其移除。
904902

@@ -911,6 +909,10 @@ This means that support is still available but will be removed in a future Kuber
911909
(于 v1.25 **弃用**)
912910
* [`vsphereVolume`](/zh-cn/docs/concepts/storage/volumes/#vspherevolume) - vSphere VMDK 卷
913911
(于 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 **弃用**)
914916

915917
<!--
916918
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
932934
* [`storageos`](/docs/concepts/storage/volumes/#storageos) - StorageOS volume
933935
(**not available** starting v1.25)
934936
-->
935-
936937
旧版本的 Kubernetes 仍支持这些“树内(In-Tree)”持久卷类型:
937938

938939
* [`awsElasticBlockStore`](/zh-cn/docs/concepts/storage/volumes/#awselasticblockstore) - AWS Elastic Block Store (EBS)
@@ -1179,7 +1180,6 @@ Kubernetes 使用卷访问模式来匹配 PersistentVolumeClaim 和 PersistentVo
11791180
| VsphereVolume | &#x2713; | - | - (works when Pods are collocated) | - |
11801181
| PortworxVolume | &#x2713; | - | &#x2713; | - | - |
11811182
-->
1182-
11831183
| 卷插件 | ReadWriteOnce | ReadOnlyMany | ReadWriteMany | ReadWriteOncePod |
11841184
| :--- | :---: | :---: | :---: | - |
11851185
| AzureFile | &#x2713; | &#x2713; | &#x2713; | - |
@@ -1263,15 +1263,25 @@ Not all Persistent Volume types support mount options.
12631263

12641264
<!--
12651265
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`
12661275
-->
12671276
以下卷类型支持挂载选项:
12681277

12691278
* `azureFile`
1270-
* `cephfs`
1271-
* `gcePersistentDisk`
1279+
* `cephfs`(于 v1.28 中**弃用**)
1280+
* `cinder`(于 v1.18 中**弃用**)
1281+
* `gcePersistentDisk`(于 v1.28 中**弃用**)
12721282
* `iscsi`
12731283
* `nfs`
1274-
* `rbd`
1284+
* `rbd`(于 v1.28 中**弃用**)
12751285
* `vsphereVolume`
12761286

12771287
<!--
@@ -1321,25 +1331,67 @@ API 参考关于该字段的更多细节。
13211331
<!--
13221332
### Phase
13231333

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
13251338

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
13301341

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
13321347
-->
13331348
### 阶段 {#phase}
13341349

1335-
每个卷会处于以下阶段(Phase)之一:
1350+
每个持久卷会处于以下阶段(Phase)之一:
1351+
1352+
`Available`
1353+
: 卷是一个空闲资源,尚未绑定到任何申领
1354+
1355+
`Bound`
1356+
: 该卷已经绑定到某申领
13361357

1337-
* Available(可用)-- 卷是一个空闲资源,尚未绑定到任何申领;
1338-
* Bound(已绑定)-- 该卷已经绑定到某申领;
1339-
* Released(已释放)-- 所绑定的申领已被删除,但是资源尚未被集群回收;
1340-
* Failed(失败)-- 卷的自动回收操作失败。
1358+
`Released`
1359+
: 所绑定的申领已被删除,但是关联存储资源尚未被集群回收
13411360

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 >}}
13431395

13441396
## PersistentVolumeClaims
13451397

@@ -1403,8 +1455,7 @@ applies to both volumes and claims.
14031455
### 资源 {#resources}
14041456

14051457
申领和 Pod 一样,也可以请求特定数量的资源。在这个上下文中,请求的资源是存储。
1406-
卷和申领都使用相同的
1407-
[资源模型](https://git.k8s.io/design-proposals-archive/scheduling/resources.md)。
1458+
卷和申领都使用相同的[资源模型](https://git.k8s.io/design-proposals-archive/scheduling/resources.md)。
14081459

14091460
<!--
14101461
### Selector
@@ -1475,9 +1526,9 @@ PV 卷(未设置注解或者注解值为 `""` 的 PersistentVolume(PV)对
14751526
PVs of that default. Specifying a default StorageClass is done by setting the
14761527
annotation `storageclass.kubernetes.io/is-default-class` equal to `true` in
14771528
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.
14811532
* If the admission plugin is turned off, there is no notion of a default
14821533
StorageClass. All PVCs that have `storageClassName` set to `""` can be
14831534
bound only to PVs that have `storageClassName` also set to `""`.
@@ -1490,7 +1541,7 @@ PV 卷(未设置注解或者注解值为 `""` 的 PersistentVolume(PV)对
14901541
设置默认 StorageClass 的工作是通过将对应 StorageClass 对象的注解
14911542
`storageclass.kubernetes.io/is-default-class` 赋值为 `true` 来完成的。
14921543
如果管理员未设置默认存储类,集群对 PVC 创建的处理方式与未启用准入控制器插件时相同。
1493-
如果设定的默认存储类不止一个,准入控制插件会禁止所有创建 PVC 操作
1544+
如果设定的默认存储类不止一个, PVC 被动态制备时将使用最新的默认存储类
14941545
* 如果准入控制器插件被关闭,则不存在默认 StorageClass 的说法。
14951546
所有将 `storageClassName` 设为 `""` 的 PVC 只能被绑定到也将 `storageClassName` 设为 `""` 的 PV。
14961547
不过,只要默认的 StorageClass 可用,就可以稍后更新缺少 `storageClassName` 的 PVC。
@@ -1536,7 +1587,7 @@ it won't be supported in a future Kubernetes release.
15361587
-->
15371588
#### 可追溯的默认 StorageClass 赋值 {#retroactive-default-storageclass-assignment}
15381589

1539-
{{< feature-state for_k8s_version="v1.26" state="beta" >}}
1590+
{{< feature-state for_k8s_version="v1.28" state="stable" >}}
15401591

15411592
<!--
15421593
You can create a PersistentVolumeClaim without specifying a `storageClassName`
@@ -1654,18 +1705,22 @@ applicable:
16541705
<!--
16551706
* CSI
16561707
* FC (Fibre Channel)
1657-
* GCEPersistentDisk
1708+
* GCEPersistentDisk (deprecated)
16581709
* iSCSI
16591710
* Local volume
1660-
* RBD (Ceph Block Device)
1711+
* OpenStack Cinder
1712+
* RBD (deprecated)
1713+
* RBD (Ceph Block Device; deprecated)
16611714
* VsphereVolume
16621715
-->
16631716
* CSI
16641717
* FC(光纤通道)
1665-
* GCEPersistentDisk
1718+
* GCEPersistentDisk(已弃用)
16661719
* iSCSI
16671720
* Local 卷
1668-
* RBD(Ceph 块设备)
1721+
* OpenStack Cinder
1722+
* RBD(已弃用)
1723+
* RBD(Ceph 块设备,已弃用)
16691724
* VsphereVolume
16701725

16711726
<!--

0 commit comments

Comments
 (0)