@@ -79,7 +79,7 @@ request specific levels of resources (CPU and Memory). Claims can request specif
79
79
size and access modes (e.g., they can be mounted ReadWriteOnce, ReadOnlyMany,
80
80
ReadWriteMany, or ReadWriteOncePod, see [AccessModes](#access-modes)).
81
81
-->
82
- ** 持久卷申领(PersistentVolumeClaim,PVC)** 表达的是用户对存储的请求。 概念上与 Pod 类似。
82
+ ** 持久卷申领(PersistentVolumeClaim,PVC)** 表达的是用户对存储的请求, 概念上与 Pod 类似。
83
83
Pod 会耗用节点资源,而 PVC 申领会耗用 PV 资源。Pod 可以请求特定数量的资源(CPU
84
84
和内存)。同样 PVC 申领也可以请求特定的大小和访问模式
85
85
(例如,可以挂载为 ReadWriteOnce、ReadOnlyMany、ReadWriteMany 或 ReadWriteOncePod,
@@ -511,7 +511,8 @@ Events: <none>
511
511
The finalizer `external-provisioner.volume.kubernetes.io/finalizer` is added for CSI volumes.
512
512
The following is an example :
513
513
-->
514
- 终结器 `external-provisioner.volume.kubernetes.io/finalizer` 会被添加到 CSI 卷上。下面是一个例子:
514
+ 终结器 `external-provisioner.volume.kubernetes.io/finalizer`
515
+ 会被添加到 CSI 卷上。下面是一个例子:
515
516
516
517
` ` ` none
517
518
Name: pvc-2f0bab97-85a8-4552-8044-eb8be45cf48d
@@ -823,7 +824,7 @@ administrator intervention.
823
824
1. 将绑定到 PVC 申领的 PV 卷标记为 `Retain` 回收策略。
824
825
2. 删除 PVC 对象。由于 PV 的回收策略为 `Retain`,我们不会在重建 PVC 时丢失数据。
825
826
3. 删除 PV 规约中的 `claimRef` 项,这样新的 PVC 可以绑定到该卷。
826
- 这一操作会使得 PV 卷变为 "可用(Available)"。
827
+ 这一操作会使得 PV 卷变为"可用(Available)"。
827
828
4. 使用小于 PV 卷大小的尺寸重建 PVC,设置 PVC 的 `volumeName` 字段为 PV 卷的名称。
828
829
这一操作将把新的 PVC 对象绑定到现有的 PV 卷。
829
830
5. 不要忘记恢复 PV 卷上设置的回收策略。
@@ -1120,15 +1121,6 @@ The access modes are:
1120
1121
1121
1122
` ReadOnlyMany`
1122
1123
: the volume can be mounted as read-only by many nodes.
1123
-
1124
- ` ReadWriteMany`
1125
- : the volume can be mounted as read-write by many nodes.
1126
-
1127
- ` ReadWriteOncePod`
1128
- : {{< feature-state for_k8s_version="v1.29" state="stable" >}}
1129
- the volume can be mounted as read-write by a single Pod. Use ReadWriteOncePod
1130
- access mode if you want to ensure that only one pod across the whole cluster can
1131
- read that PVC or write to it.
1132
1124
-->
1133
1125
访问模式有:
1134
1126
@@ -1140,6 +1132,16 @@ The access modes are:
1140
1132
` ReadOnlyMany`
1141
1133
: 卷可以被多个节点以只读方式挂载。
1142
1134
1135
+ <!--
1136
+ ` ReadWriteMany`
1137
+ : the volume can be mounted as read-write by many nodes.
1138
+
1139
+ ` ReadWriteOncePod`
1140
+ : {{< feature-state for_k8s_version="v1.29" state="stable" >}}
1141
+ the volume can be mounted as read-write by a single Pod. Use ReadWriteOncePod
1142
+ access mode if you want to ensure that only one pod across the whole cluster can
1143
+ read that PVC or write to it.
1144
+ -->
1143
1145
` ReadWriteMany`
1144
1146
: 卷可以被多个节点以读写方式挂载。
1145
1147
@@ -1161,8 +1163,8 @@ to these versions or greater:
1161
1163
* [csi-attacher:v3.3.0+](https://github.com/kubernetes-csi/external-attacher/releases/tag/v3.3.0)
1162
1164
* [csi-resizer:v1.3.0+](https://github.com/kubernetes-csi/external-resizer/releases/tag/v1.3.0)
1163
1165
-->
1164
- ` ReadWriteOncePod` 访问模式仅适用于 {{< glossary_tooltip text="CSI" term_id="csi" >}} 卷和 Kubernetes v1.22+。
1165
- 要使用此特性,你需要将以下
1166
+ ` ReadWriteOncePod` 访问模式仅适用于 {{< glossary_tooltip text="CSI" term_id="csi" >}}
1167
+ 卷和 Kubernetes v1.22+。 要使用此特性,你需要将以下
1166
1168
[CSI 边车](https://kubernetes-csi.github.io/docs/sidecar-containers.html)更新为下列或更高版本:
1167
1169
1168
1170
- [csi-provisioner:v3.0.0+](https://github.com/kubernetes-csi/external-provisioner/releases/tag/v3.0.0)
@@ -1397,7 +1399,8 @@ A PersistentVolume will be in one of the following phases:
1397
1399
<!--
1398
1400
You can see the name of the PVC bound to the PV using `kubectl describe persistentvolume <name>`.
1399
1401
-->
1400
- 你可以使用 `kubectl describe persistentvolume <name>` 查看已绑定到 PV 的 PVC 的名称。
1402
+ 你可以使用 `kubectl describe persistentvolume <name>` 查看已绑定到
1403
+ PV 的 PVC 的名称。
1401
1404
1402
1405
<!--
1403
1406
# ### Phase transition timestamp
@@ -1496,13 +1499,27 @@ applies to both volumes and claims.
1496
1499
申领和 Pod 一样,也可以请求特定数量的资源。在这个上下文中,请求的资源是存储。
1497
1500
卷和申领都使用相同的[资源模型](https://git.k8s.io/design-proposals-archive/scheduling/resources.md)。
1498
1501
1502
+ {{< note >}}
1503
+ <!--
1504
+ For `Filesystem` volumes, the storage request refers to the "outer" volume size
1505
+ (i.e. the allocated size from the storage backend).
1506
+ This means that the writeable size may be slightly lower for providers that
1507
+ build a filesystem on top of a block device, due to filesystem overhead.
1508
+ This is especially visible with XFS, where many metadata features are enabled by default.
1509
+ -->
1510
+ 对于 `Filesystem` 类型的卷,存储请求指的是“外部”卷的大小(即从存储后端分配的大小)。
1511
+ 这意味着,对于在块设备之上构建文件系统的提供商来说,由于文件系统开销,可写入的大小可能会略小。
1512
+ 这种情况在 XFS 文件系统中尤为明显,因为默认启用了许多元数据功能。
1513
+ {{< /note >}}
1514
+
1499
1515
<!--
1500
1516
# ## Selector
1501
1517
1502
1518
Claims can specify a
1503
1519
[label selector](/docs/concepts/overview/working-with-objects/labels/#label-selectors)
1504
- to further filter the set of volumes. Only the volumes whose labels match the selector
1505
- can be bound to the claim. The selector can consist of two fields :
1520
+ to further filter the set of volumes.
1521
+ Only the volumes whose labels match the selector can be bound to the claim.
1522
+ The selector can consist of two fields :
1506
1523
-->
1507
1524
# ## 选择算符 {#selector}
1508
1525
@@ -1513,15 +1530,15 @@ can be bound to the claim. The selector can consist of two fields:
1513
1530
<!--
1514
1531
* `matchLabels` - the volume must have a label with this value
1515
1532
* `matchExpressions` - a list of requirements made by specifying key, list of values,
1516
- and operator that relates the key and values. Valid operators include In, NotIn,
1517
- Exists, and DoesNotExist.
1533
+ and operator that relates the key and values.
1534
+ Valid operators include `In`, `NotIn`, ` Exists` , and ` DoesNotExist` .
1518
1535
1519
1536
All of the requirements, from both `matchLabels` and `matchExpressions`, are
1520
1537
ANDed together – they must all be satisfied in order to match.
1521
1538
-->
1522
1539
* `matchLabels` - 卷必须包含带有此值的标签
1523
1540
* `matchExpressions` - 通过设定键(key)、值列表和操作符(operator)
1524
- 来构造的需求。合法的操作符有 In、 NotIn、 Exists 和 DoesNotExist。
1541
+ 来构造的需求。合法的操作符有 `In`、` NotIn`、` Exists` 和 ` DoesNotExist` 。
1525
1542
1526
1543
来自 `matchLabels` 和 `matchExpressions` 的所有需求都按逻辑与的方式组合在一起。
1527
1544
这些需求都必须被满足才被视为匹配。
@@ -1532,8 +1549,8 @@ ANDed together – they must all be satisfied in order to match.
1532
1549
A claim can request a particular class by specifying the name of a
1533
1550
[StorageClass](/docs/concepts/storage/storage-classes/)
1534
1551
using the attribute `storageClassName`.
1535
- Only PVs of the requested class, ones with the same `storageClassName` as the PVC, can
1536
- be bound to the PVC.
1552
+ Only PVs of the requested class, ones with the same `storageClassName` as the PVC,
1553
+ can be bound to the PVC.
1537
1554
-->
1538
1555
# ## 类 {#class}
1539
1556
@@ -1545,8 +1562,8 @@ be bound to the PVC.
1545
1562
<!--
1546
1563
PVCs don't necessarily have to request a class. A PVC with its `storageClassName` set
1547
1564
equal to `""` is always interpreted to be requesting a PV with no class, so it
1548
- can only be bound to PVs with no class (no annotation or one set equal to
1549
- ` "" ` ). A PVC with no `storageClassName` is not quite the same and is treated differently
1565
+ can only be bound to PVs with no class (no annotation or one set equal to `""`).
1566
+ A PVC with no `storageClassName` is not quite the same and is treated differently
1550
1567
by the cluster, depending on whether the
1551
1568
[`DefaultStorageClass` admission plugin](/docs/reference/access-authn-authz/admission-controllers/#defaultstorageclass)
1552
1569
is turned on.
@@ -1559,20 +1576,19 @@ PV 卷(未设置注解或者注解值为 `""` 的 PersistentVolume(PV)对
1559
1576
[`DefaultStorageClass` 准入控制器插件](/zh-cn/docs/reference/access-authn-authz/admission-controllers/#defaultstorageclass)是否被启用。
1560
1577
1561
1578
<!--
1562
- * If the admission plugin is turned on, the administrator may specify a
1563
- default StorageClass. All PVCs that have no `storageClassName` can be bound only to
1564
- PVs of that default. Specifying a default StorageClass is done by setting the
1565
- annotation `storageclass.kubernetes.io/is-default-class` equal to `true` in
1566
- a StorageClass object. If the administrator does not specify a default, the
1567
- cluster responds to PVC creation as if the admission plugin were turned off. If more than one
1568
- default StorageClass is specified, the newest default is used when the
1569
- PVC is dynamically provisioned.
1570
- * If the admission plugin is turned off, there is no notion of a default
1571
- StorageClass. All PVCs that have `storageClassName` set to `""` can be
1572
- bound only to PVs that have `storageClassName` also set to `""`.
1573
- However, PVCs with missing `storageClassName` can be updated later once
1574
- default StorageClass becomes available. If the PVC gets updated it will no
1575
- longer bind to PVs that have `storageClassName` also set to `""`.
1579
+ * If the admission plugin is turned on, the administrator may specify a default StorageClass.
1580
+ All PVCs that have no `storageClassName` can be bound only to PVs of that default.
1581
+ Specifying a default StorageClass is done by setting the annotation
1582
+ ` storageclass.kubernetes.io/is-default-class` equal to `true` in a StorageClass object.
1583
+ If the administrator does not specify a default, the cluster responds to PVC creation
1584
+ as if the admission plugin were turned off.
1585
+ If more than one default StorageClass is specified, the newest default is used when
1586
+ the PVC is dynamically provisioned.
1587
+ * If the admission plugin is turned off, there is no notion of a default StorageClass.
1588
+ All PVCs that have `storageClassName` set to `""` can be bound only to PVs
1589
+ that have `storageClassName` also set to `""`.
1590
+ However, PVCs with missing `storageClassName` can be updated later once default StorageClass becomes available.
1591
+ If the PVC gets updated it will no longer bind to PVs that have `storageClassName` also set to `""`.
1576
1592
-->
1577
1593
* 如果准入控制器插件被启用,则管理员可以设置一个默认的 StorageClass。
1578
1594
所有未设置 `storageClassName` 的 PVC 都只能绑定到隶属于默认存储类的 PV 卷。
@@ -1635,7 +1651,8 @@ in your cluster. In this case, the new PVC creates as you defined it, and the
1635
1651
-->
1636
1652
你可以创建 PersistentVolumeClaim,而无需为新 PVC 指定 `storageClassName`。
1637
1653
即使你的集群中不存在默认 StorageClass,你也可以这样做。
1638
- 在这种情况下,新的 PVC 会按照你的定义进行创建,并且在默认值可用之前,该 PVC 的 `storageClassName` 保持不设置。
1654
+ 在这种情况下,新的 PVC 会按照你的定义进行创建,并且在默认值可用之前,该 PVC 的
1655
+ ` storageClassName` 保持不设置。
1639
1656
1640
1657
<!--
1641
1658
When a default StorageClass becomes available, the control plane identifies any
@@ -1645,8 +1662,8 @@ updates those PVCs to set `storageClassName` to match the new default StorageCla
1645
1662
If you have an existing PVC where the `storageClassName` is `""`, and you configure
1646
1663
a default StorageClass, then this PVC will not get updated.
1647
1664
-->
1648
- 当一个默认的 StorageClass 变得可用时,控制平面会识别所有未设置 `storageClassName` 的现有 PVC。
1649
- 对于 `storageClassName` 为空值或没有此主键的 PVC,
1665
+ 当一个默认的 StorageClass 变得可用时,控制平面会识别所有未设置 `storageClassName`
1666
+ 的现有 PVC。 对于 `storageClassName` 为空值或没有此主键的 PVC,
1650
1667
控制平面会更新这些 PVC 以设置其 `storageClassName` 与新的默认 StorageClass 匹配。
1651
1668
如果你有一个现有的 PVC,其中 `storageClassName` 是 `""`,
1652
1669
并且你配置了默认 StorageClass,则此 PVC 将不会得到更新。
@@ -1928,7 +1945,8 @@ only available for CSI volume plugins.
1928
1945
-->
1929
1946
# # 卷克隆 {#volume-cloning}
1930
1947
1931
- [卷克隆](/zh-cn/docs/concepts/storage/volume-pvc-datasource/)功能特性仅适用于 CSI 卷插件。
1948
+ [卷克隆](/zh-cn/docs/concepts/storage/volume-pvc-datasource/)功能特性仅适用于
1949
+ CSI 卷插件。
1932
1950
1933
1951
<!--
1934
1952
# ## Create PersistentVolumeClaim from an existing PVC {#create-persistent-volume-claim-from-an-existing-pvc}
0 commit comments