Skip to content

Commit 1e03e91

Browse files
authored
Merge pull request #47957 from my-git9/pp-7605
[zh-cn] sync persistent-volume-claim-v1.md
2 parents 415c5c5 + 7b9233a commit 1e03e91

File tree

1 file changed

+103
-46
lines changed

1 file changed

+103
-46
lines changed

content/zh-cn/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1.md

Lines changed: 103 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ api_metadata:
66
content_type: "api_reference"
77
description: "PersistentVolumeClaim 是用户针对一个持久卷的请求和申领。"
88
title: "PersistentVolumeClaim"
9-
weight: 4
9+
weight: 6
1010
---
1111
<!--
1212
api_metadata:
@@ -16,7 +16,7 @@ api_metadata:
1616
content_type: "api_reference"
1717
description: "PersistentVolumeClaim is a user's request for and claim to a persistent volume."
1818
title: "PersistentVolumeClaim"
19-
weight: 4
19+
weight: 6
2020
-->
2121

2222
`apiVersion: v1`
@@ -71,6 +71,8 @@ PersistentVolumeClaimSpec describes the common attributes of storage devices and
7171
<hr>
7272
- **accessModes** ([]string)
7373
74+
*Atomic: will be replaced during a merge*
75+
7476
accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
7577
7678
- **selector** (<a href="{{< ref "../common-definitions/label-selector#LabelSelector" >}}">LabelSelector</a>)
@@ -83,6 +85,8 @@ PersistentVolumeClaimSpec 描述存储设备的常用参数,并支持通过 so
8385

8486
- **accessModes** ([]string)
8587

88+
**原子性:将在合并期间被替换**
89+
8690
accessModes 包含卷应具备的预期访问模式。更多信息:
8791
https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#access-modes-1
8892

@@ -91,57 +95,24 @@ PersistentVolumeClaimSpec 描述存储设备的常用参数,并支持通过 so
9195
selector 是在绑定时对卷进行选择所执行的标签查询。
9296

9397
<!--
94-
- **resources** (ResourceRequirements)
98+
- **resources** (VolumeResourceRequirements)
9599
96100
resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
97-
98-
<a name="ResourceRequirements"></a>
99-
*ResourceRequirements describes the compute resource requirements.*
100101
-->
101-
- **resources** (ResourceRequirements)
102+
- **resources** (VolumeResourceRequirements)
102103

103104
resources 表示卷应拥有的最小资源。
104105
如果启用了 RecoverVolumeExpansionFailure 功能特性,则允许用户指定这些资源要求,
105106
此值必须低于之前的值,但必须高于申领的状态字段中记录的容量。更多信息:
106107
https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#resources
107108

108-
<a name="ResourceRequirements"></a>
109-
**ResourceRequirements 描述计算资源要求。**
110-
111-
- **resources.claims** ([]ResourceClaim)
112-
113-
<!--
114-
*Map: unique values on key name will be kept during a merge*
115-
116-
Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.
117-
118-
This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.
119-
120-
This field is immutable. It can only be set for containers.
121-
-->
122-
123-
**集合:键 name 的唯一值将在合并期间被保留**
124-
125-
claims 列出了此容器使用的、在 spec.resourceClaims 中定义的资源的名称。
126-
127-
这是一个 Alpha 字段,需要启用 DynamicResourceAllocation 特性门控。
128-
129-
此字段是不可变的。
109+
<a name="VolumeResourceRequirements"></a>
130110

131-
<!--
132-
<a name="ResourceClaim"></a>
133-
*ResourceClaim references one entry in PodSpec.ResourceClaims.*
134-
135-
- **resources.claims.name** (string), required
136-
137-
Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
138-
-->
139-
<a name="ResourceClaim"></a>
140-
**ResourceClaim 引用 PodSpec.ResourceClaims 中的一个条目。**
141-
142-
- **resources.claims.name** (string),必需
111+
<!--
112+
*VolumeResourceRequirements describes the storage resource requirements for a volume.*
113+
-->
143114

144-
对于使用此字段的 Pod,name 必须与 pod.spec.resourceClaims 中的一个条目的名称匹配。
115+
**VolumeResourceRequirements 描述了卷的存储资源要求。**
145116

146117
<!--
147118
- **resources.limits** (map[string]<a href="{{< ref "../common-definitions/quantity#Quantity" >}}">Quantity</a>)
@@ -280,13 +251,33 @@ dataSourceRef specifies the object from which to populate the volume with data,
280251
以允许该名字空间的所有者接受引用。有关详细信息,请参阅 ReferenceGrant 文档。
281252
(Alpha) 此字段需要启用 CrossNamespaceVolumeDataSource 特性门控。
282253

254+
- **volumeAttributesClassName** (string)
255+
256+
<!--
257+
volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
258+
-->
259+
260+
`volumeAttributesClassName` 可用于设置此申领所使用的 VolumeAttributesClass。
261+
如果设置了此字段,CSI 驱动程序将使用相应 VolumeAttributesClass 中定义的属性创建或更新卷。
262+
`storageClassName` 的用途不同,此属性可以在创建申领之后更改。空字符串值表示不会将 VolumeAttributesClass
263+
应用于申领,但一旦设置,就不允许将此字段重置为空字符串。如果未指定且 PersistentVolumeClaim 未绑定,
264+
则持久卷控制器将设置默认的 VolumeAttributesClass(如果存在)。
265+
如果 VolumeAttributesClass 所引用的资源不存在,则此 PersistentVolumeClaim 将被设置为 Pending 状态,
266+
`modifyVolumeStatus` 字段所示,直到存在此类资源。更多信息:
267+
https://kubernetes.io/zh-cn/docs/concepts/storage/volume-attributes-classes/
268+
269+
(Beta)使用此字段需要启用 VolumeAttributesClass 特性门控(默认情况下关闭)。
270+
283271
## PersistentVolumeClaimStatus {#PersistentVolumeClaimStatus}
284272
<!--
285273
PersistentVolumeClaimStatus is the current status of a persistent volume claim.
286274
287275
<hr>
288276
289277
- **accessModes** ([]string)
278+
279+
*Atomic: will be replaced during a merge*
280+
290281
accessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
291282
-->
292283
PersistentVolumeClaimStatus 是持久卷申领的当前状态。
@@ -295,6 +286,8 @@ PersistentVolumeClaimStatus 是持久卷申领的当前状态。
295286

296287
- **accessModes** ([]string)
297288

289+
**原子性:将在合并期间被替换**
290+
298291
accessModes 包含支持 PVC 的卷所具有的实际访问模式。更多信息:
299292
https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#access-modes-1
300293

@@ -415,7 +408,9 @@ PersistentVolumeClaimStatus 是持久卷申领的当前状态。
415408
- **conditions** ([]PersistentVolumeClaimCondition)
416409
*Patch strategy: merge on key `type`*
417410
418-
conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'.
411+
*Map: unique values on key type will be kept during a merge*
412+
413+
conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'Resizing'.
419414
420415
<a name="PersistentVolumeClaimCondition"></a>
421416
*PersistentVolumeClaimCondition contains details about state of pvc*
@@ -424,8 +419,10 @@ PersistentVolumeClaimStatus 是持久卷申领的当前状态。
424419

425420
**补丁策略:按照键 `type` 合并**
426421

422+
**映射:基于 `name` 键的唯一值将在合并期间被保留**
423+
427424
conditions 是持久卷声明的当前的状况。
428-
如果正在调整底层持久卷的大小,则状况将被设为 “ResizeStarted”。
425+
如果正在调整底层持久卷的大小,则状况将被设为 “Resizing”。
429426

430427
<a name="PersistentVolumeClaimCondition"></a>
431428
**PersistentVolumeClaimCondition 包含有关 PVC 状态的详细信息。**
@@ -464,7 +461,7 @@ PersistentVolumeClaimStatus 是持久卷申领的当前状态。
464461
message is the human-readable message indicating details about last transition.
465462
466463
- **conditions.reason** (string)
467-
reason is a unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports "ResizeStarted" that means the underlying persistent volume is being resized.
464+
reason is a unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports "Resizing" that means the underlying persistent volume is being resized.
468465
-->
469466
- **conditions.lastTransitionTime** (Time)
470467

@@ -481,7 +478,67 @@ PersistentVolumeClaimStatus 是持久卷申领的当前状态。
481478
- **conditions.reason** (string)
482479

483480
reason 是唯一的,它应该是一个机器可理解的简短字符串,指明上次状况转换的原因。
484-
如果它报告 “ResizeStarted”,则意味着正在调整底层持久卷的大小。
481+
如果它报告 “Resizing”,则意味着正在调整底层持久卷的大小。
482+
483+
- **currentVolumeAttributesClassName** (string)
484+
485+
<!--
486+
currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim This is a beta field and requires enabling VolumeAttributesClass feature (off by default).
487+
-->
488+
489+
`currentVolumeAttributesClassName` 是 PVC 所使用的 VolumeAttributesClass 的当前名称。
490+
这是一个 Beta 级别字段,需要启用 VolumeAttributesClass 特性(默认情况下处于关闭状态)。
491+
492+
- **modifyVolumeStatus** (ModifyVolumeStatus)
493+
494+
<!--
495+
ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted. This is a beta field and requires enabling VolumeAttributesClass feature (off by default).
496+
-->
497+
498+
`modifyVolumeStatus` 表示 ControllerModifyVolume 操作的状态对象。
499+
如果未设置,则表示没有尝试执行任何修改卷操作。这是一个测试字段,需要启用
500+
VolumeAttributesClass 特性(默认关闭)。
501+
502+
<a name="ModifyVolumeStatus"></a>
503+
504+
<!--
505+
*ModifyVolumeStatus represents the status object of ControllerModifyVolume operation*
506+
-->
507+
508+
**ModifyVolumeStatus 表示 ControllerModifyVolume 操作的状态对象**
509+
510+
<!--
511+
- **modifyVolumeStatus.status** (string), required
512+
513+
status is the status of the ControllerModifyVolume operation. It can be in any of following states:
514+
- Pending
515+
Pending indicates that the PersistentVolumeClaim cannot be modified due to unmet requirements, such as
516+
the specified VolumeAttributesClass not existing.
517+
- InProgress
518+
InProgress indicates that the volume is being modified.
519+
- Infeasible
520+
Infeasible indicates that the request has been rejected as invalid by the CSI driver. To
521+
resolve the error, a valid VolumeAttributesClass needs to be specified.
522+
Note: New statuses can be added in the future. Consumers should check for unknown statuses and fail appropriately.
523+
-->
524+
525+
- **modifyVolumeStatus.status** (string),必需
526+
527+
status 是 ControllerModifyVolume 操作的状态。它可以是以下任一状态:
528+
- Pending
529+
Pending 表示由于未满足要求(例如指定的 VolumeAttributesClass 不存在)而无法修改 PersistentVolumeClaim。
530+
- InProgress
531+
InProgress 表示卷正在被修改。
532+
- Infeasible
533+
Infeasible 表示请求已被 CSI 驱动程序拒绝,因为请求无效。要解决此错误,需要指定有效的 VolumeAttributesClass。
534+
注意:将来可能会添加新状态。消费者应当检查未知状态,并适当地处理失败情况。
535+
536+
- **modifyVolumeStatus.targetVolumeAttributesClassName** (string)
537+
538+
<!--
539+
targetVolumeAttributesClassName is the name of the VolumeAttributesClass the PVC currently being reconciled
540+
-->
541+
`targetVolumeAttributesClassName` 是当前正在协调的 PVC 的 VolumeAttributesClass 的名称
485542

486543
<!--
487544
- **phase** (string)

0 commit comments

Comments
 (0)