Skip to content

Commit 877b34f

Browse files
committed
[zh-cn]sync persistent-volumes.md
Signed-off-by: xin.li <[email protected]>
1 parent a7b6439 commit 877b34f

File tree

1 file changed

+60
-42
lines changed

1 file changed

+60
-42
lines changed

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

+60-42
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ request specific levels of resources (CPU and Memory). Claims can request specif
7979
size and access modes (e.g., they can be mounted ReadWriteOnce, ReadOnlyMany,
8080
ReadWriteMany, or ReadWriteOncePod, see [AccessModes](#access-modes)).
8181
-->
82-
**持久卷申领(PersistentVolumeClaim,PVC)** 表达的是用户对存储的请求概念上与 Pod 类似。
82+
**持久卷申领(PersistentVolumeClaim,PVC)** 表达的是用户对存储的请求概念上与 Pod 类似。
8383
Pod 会耗用节点资源,而 PVC 申领会耗用 PV 资源。Pod 可以请求特定数量的资源(CPU
8484
和内存)。同样 PVC 申领也可以请求特定的大小和访问模式
8585
(例如,可以挂载为 ReadWriteOnce、ReadOnlyMany、ReadWriteMany 或 ReadWriteOncePod,
@@ -511,7 +511,8 @@ Events: <none>
511511
The finalizer `external-provisioner.volume.kubernetes.io/finalizer` is added for CSI volumes.
512512
The following is an example:
513513
-->
514-
终结器 `external-provisioner.volume.kubernetes.io/finalizer` 会被添加到 CSI 卷上。下面是一个例子:
514+
终结器 `external-provisioner.volume.kubernetes.io/finalizer`
515+
会被添加到 CSI 卷上。下面是一个例子:
515516

516517
```none
517518
Name: pvc-2f0bab97-85a8-4552-8044-eb8be45cf48d
@@ -823,7 +824,7 @@ administrator intervention.
823824
1. 将绑定到 PVC 申领的 PV 卷标记为 `Retain` 回收策略。
824825
2. 删除 PVC 对象。由于 PV 的回收策略为 `Retain`,我们不会在重建 PVC 时丢失数据。
825826
3. 删除 PV 规约中的 `claimRef` 项,这样新的 PVC 可以绑定到该卷。
826-
这一操作会使得 PV 卷变为 "可用(Available)"。
827+
这一操作会使得 PV 卷变为"可用(Available)"。
827828
4. 使用小于 PV 卷大小的尺寸重建 PVC,设置 PVC 的 `volumeName` 字段为 PV 卷的名称。
828829
这一操作将把新的 PVC 对象绑定到现有的 PV 卷。
829830
5. 不要忘记恢复 PV 卷上设置的回收策略。
@@ -1120,15 +1121,6 @@ The access modes are:
11201121

11211122
`ReadOnlyMany`
11221123
: 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.
11321124
-->
11331125
访问模式有:
11341126

@@ -1140,6 +1132,16 @@ The access modes are:
11401132
`ReadOnlyMany`
11411133
: 卷可以被多个节点以只读方式挂载。
11421134

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+
-->
11431145
`ReadWriteMany`
11441146
: 卷可以被多个节点以读写方式挂载。
11451147

@@ -1161,8 +1163,8 @@ to these versions or greater:
11611163
* [csi-attacher:v3.3.0+](https://github.com/kubernetes-csi/external-attacher/releases/tag/v3.3.0)
11621164
* [csi-resizer:v1.3.0+](https://github.com/kubernetes-csi/external-resizer/releases/tag/v1.3.0)
11631165
-->
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+。要使用此特性,你需要将以下
11661168
[CSI 边车](https://kubernetes-csi.github.io/docs/sidecar-containers.html)更新为下列或更高版本:
11671169

11681170
- [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:
13971399
<!--
13981400
You can see the name of the PVC bound to the PV using `kubectl describe persistentvolume <name>`.
13991401
-->
1400-
你可以使用 `kubectl describe persistentvolume <name>` 查看已绑定到 PV 的 PVC 的名称。
1402+
你可以使用 `kubectl describe persistentvolume <name>` 查看已绑定到
1403+
PV 的 PVC 的名称。
14011404

14021405
<!--
14031406
#### Phase transition timestamp
@@ -1496,13 +1499,27 @@ applies to both volumes and claims.
14961499
申领和 Pod 一样,也可以请求特定数量的资源。在这个上下文中,请求的资源是存储。
14971500
卷和申领都使用相同的[资源模型](https://git.k8s.io/design-proposals-archive/scheduling/resources.md)。
14981501

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+
14991515
<!--
15001516
### Selector
15011517

15021518
Claims can specify a
15031519
[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:
15061523
-->
15071524
### 选择算符 {#selector}
15081525

@@ -1513,15 +1530,15 @@ can be bound to the claim. The selector can consist of two fields:
15131530
<!--
15141531
* `matchLabels` - the volume must have a label with this value
15151532
* `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`.
15181535

15191536
All of the requirements, from both `matchLabels` and `matchExpressions`, are
15201537
ANDed together – they must all be satisfied in order to match.
15211538
-->
15221539
* `matchLabels` - 卷必须包含带有此值的标签
15231540
* `matchExpressions` - 通过设定键(key)、值列表和操作符(operator)
1524-
来构造的需求。合法的操作符有 In、NotInExists 和 DoesNotExist。
1541+
来构造的需求。合法的操作符有 `In`、`NotIn`、`Exists``DoesNotExist`
15251542

15261543
来自 `matchLabels` 和 `matchExpressions` 的所有需求都按逻辑与的方式组合在一起。
15271544
这些需求都必须被满足才被视为匹配。
@@ -1532,8 +1549,8 @@ ANDed together – they must all be satisfied in order to match.
15321549
A claim can request a particular class by specifying the name of a
15331550
[StorageClass](/docs/concepts/storage/storage-classes/)
15341551
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.
15371554
-->
15381555
### 类 {#class}
15391556

@@ -1545,8 +1562,8 @@ be bound to the PVC.
15451562
<!--
15461563
PVCs don't necessarily have to request a class. A PVC with its `storageClassName` set
15471564
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
15501567
by the cluster, depending on whether the
15511568
[`DefaultStorageClass` admission plugin](/docs/reference/access-authn-authz/admission-controllers/#defaultstorageclass)
15521569
is turned on.
@@ -1559,20 +1576,19 @@ PV 卷(未设置注解或者注解值为 `""` 的 PersistentVolume(PV)对
15591576
[`DefaultStorageClass` 准入控制器插件](/zh-cn/docs/reference/access-authn-authz/admission-controllers/#defaultstorageclass)是否被启用。
15601577

15611578
<!--
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 `""`.
15761592
-->
15771593
* 如果准入控制器插件被启用,则管理员可以设置一个默认的 StorageClass。
15781594
所有未设置 `storageClassName` 的 PVC 都只能绑定到隶属于默认存储类的 PV 卷。
@@ -1635,7 +1651,8 @@ in your cluster. In this case, the new PVC creates as you defined it, and the
16351651
-->
16361652
你可以创建 PersistentVolumeClaim,而无需为新 PVC 指定 `storageClassName`。
16371653
即使你的集群中不存在默认 StorageClass,你也可以这样做。
1638-
在这种情况下,新的 PVC 会按照你的定义进行创建,并且在默认值可用之前,该 PVC 的 `storageClassName` 保持不设置。
1654+
在这种情况下,新的 PVC 会按照你的定义进行创建,并且在默认值可用之前,该 PVC 的
1655+
`storageClassName` 保持不设置。
16391656

16401657
<!--
16411658
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
16451662
If you have an existing PVC where the `storageClassName` is `""`, and you configure
16461663
a default StorageClass, then this PVC will not get updated.
16471664
-->
1648-
当一个默认的 StorageClass 变得可用时,控制平面会识别所有未设置 `storageClassName` 的现有 PVC。
1649-
对于 `storageClassName` 为空值或没有此主键的 PVC,
1665+
当一个默认的 StorageClass 变得可用时,控制平面会识别所有未设置 `storageClassName`
1666+
的现有 PVC。对于 `storageClassName` 为空值或没有此主键的 PVC,
16501667
控制平面会更新这些 PVC 以设置其 `storageClassName` 与新的默认 StorageClass 匹配。
16511668
如果你有一个现有的 PVC,其中 `storageClassName` 是 `""`,
16521669
并且你配置了默认 StorageClass,则此 PVC 将不会得到更新。
@@ -1928,7 +1945,8 @@ only available for CSI volume plugins.
19281945
-->
19291946
## 卷克隆 {#volume-cloning}
19301947

1931-
[卷克隆](/zh-cn/docs/concepts/storage/volume-pvc-datasource/)功能特性仅适用于 CSI 卷插件。
1948+
[卷克隆](/zh-cn/docs/concepts/storage/volume-pvc-datasource/)功能特性仅适用于
1949+
CSI 卷插件。
19321950

19331951
<!--
19341952
### Create PersistentVolumeClaim from an existing PVC {#create-persistent-volume-claim-from-an-existing-pvc}

0 commit comments

Comments
 (0)