Skip to content

Commit 713d5f3

Browse files
authored
Merge pull request #38684 from windsonsea/pvcv1
[zh] sync /config-and-storage-resources/persistent-volume-claim-v1.md
2 parents fbd7819 + 9c42761 commit 713d5f3

File tree

1 file changed

+113
-26
lines changed

1 file changed

+113
-26
lines changed

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

Lines changed: 113 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,11 @@ PersistentVolumeClaimSpec 描述存储设备的常用参数,并支持通过 so
8686

8787
<!--
8888
- **resources** (ResourceRequirements)
89+
8990
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
9091
9192
<a name="ResourceRequirements"></a>
9293
*ResourceRequirements describes the compute resource requirements.*
93-
94-
- **resources.limits** (map[string]<a href="{{< ref "../common-definitions/quantity#Quantity" >}}">Quantity</a>)
95-
Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
96-
97-
- **resources.requests** (map[string]<a href="{{< ref "../common-definitions/quantity#Quantity" >}}">Quantity</a>)
98-
Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
9994
-->
10095
- **resources** (ResourceRequirements)
10196

@@ -106,7 +101,48 @@ PersistentVolumeClaimSpec 描述存储设备的常用参数,并支持通过 so
106101

107102
<a name="ResourceRequirements"></a>
108103
**ResourceRequirements 描述计算资源要求。**
109-
104+
105+
- **resources.claims** ([]ResourceClaim)
106+
107+
<!--
108+
*Set: unique values will be kept during a merge*
109+
110+
Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.
111+
112+
This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.
113+
114+
This field is immutable.
115+
-->
116+
**集合:唯一值将在合并期间被保留**
117+
118+
claims 列出了此容器使用的、在 spec.resourceClaims 中定义的资源的名称。
119+
120+
这是一个 Alpha 字段,需要启用 DynamicResourceAllocation 特性门控。
121+
122+
此字段是不可变的。
123+
124+
<!--
125+
<a name="ResourceClaim"></a>
126+
*ResourceClaim references one entry in PodSpec.ResourceClaims.*
127+
128+
- **resources.claims.name** (string), required
129+
130+
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.
131+
-->
132+
<a name="ResourceClaim"></a>
133+
**ResourceClaim 引用 PodSpec.ResourceClaims 中的一个条目。**
134+
135+
- **resources.claims.name** (string),必需
136+
137+
对于使用此字段的 Pod,name 必须与 pod.spec.resourceClaims 中的一个条目的名称匹配。
138+
139+
<!--
140+
- **resources.limits** (map[string]<a href="{{< ref "../common-definitions/quantity#Quantity" >}}">Quantity</a>)
141+
Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
142+
143+
- **resources.requests** (map[string]<a href="{{< ref "../common-definitions/quantity#Quantity" >}}">Quantity</a>)
144+
Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
145+
-->
110146
- **resources.limits** (map[string]<a href="{{< ref "../common-definitions/quantity#Quantity" >}}">Quantity</a>)
111147

112148
limits 描述允许的最大计算资源量。更多信息:
@@ -146,9 +182,10 @@ PersistentVolumeClaimSpec 描述存储设备的常用参数,并支持通过 so
146182
147183
- **dataSource** (<a href="{{< ref "../common-definitions/typed-local-object-reference#TypedLocalObjectReference" >}}">TypedLocalObjectReference</a>)
148184
149-
dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.
185+
dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.
150186
-->
151187
### Beta 级别
188+
152189
- **dataSource** (<a href="{{< ref "../common-definitions/typed-local-object-reference#TypedLocalObjectReference" >}}">TypedLocalObjectReference</a>)
153190

154191
dataSource 字段可用于二选一:
@@ -158,33 +195,83 @@ PersistentVolumeClaimSpec 描述存储设备的常用参数,并支持通过 so
158195
* 现有的 PVC (PersistentVolumeClaim)
159196

160197
如果制备器或外部控制器可以支持指定的数据源,则它将根据指定数据源的内容创建新的卷。
161-
如果 AnyVolumeDataSource 特性门控被启用,此字段的内容将始终与 dataSourceRef 字段内容相同。
198+
当 AnyVolumeDataSource 特性门控被启用时,dataSource 内容将被复制到 dataSourceRef,
199+
当 dataSourceRef.namespace 未被指定时,dataSourceRef 内容将被复制到 dataSource。
200+
如果名字空间被指定,则 dataSourceRef 不会被复制到 dataSource。
162201

163202
<!--
164-
- **dataSourceRef** (<a href="{{< ref "../common-definitions/typed-local-object-reference#TypedLocalObjectReference" >}}">TypedLocalObjectReference</a>)
203+
- **dataSourceRef** (TypedObjectReference)
165204
166-
dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef
167-
allows any non-core object, as well as PersistentVolumeClaim objects.
168-
* While DataSource ignores disallowed values (dropping them), DataSourceRef
169-
preserves all values, and generates an error if a disallowed value is
170-
specified.
171-
(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.
205+
dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef:
172206
-->
173-
- **dataSourceRef** (<a href="{{< ref "../common-definitions/typed-local-object-reference#TypedLocalObjectReference" >}}">TypedLocalObjectReference</a>)
207+
- **dataSourceRef** (TypedObjectReference)
174208

175209
dataSourceRef 指定一个对象,当需要非空卷时,可以使用它来为卷填充数据。
176-
此字段值可以是来自非空 API 组(非核心对象)的一个本地对象,或一个 PersistentVolumeClaim 对象。
210+
此字段值可以是来自非空 API 组(非核心对象)的任意对象,或一个 PersistentVolumeClaim 对象。
177211
如果设置了此字段,则仅当所指定对象的类型与所安装的某些卷填充器或动态制备器匹配时,卷绑定才会成功。
178212
此字段将替换 dataSource 字段的功能,因此如果两个字段非空,其取值必须相同。
179-
为了向后兼容,如果其中一个字段为空且另一个字段非空,
180-
则两个字段(dataSource 和 dataSourceRef)将被自动设为相同的值。
181-
dataSource 和 dataSourceRef 之间有两个重要的区别:
213+
为了向后兼容,当未在 dataSourceRef 中指定名字空间时,
214+
如果(dataSource 和 dataSourceRef)其中一个字段为空且另一个字段非空,则两个字段将被自动设为相同的值。
215+
在 dataSourceRef 中指定名字空间时,dataSource 未被设置为相同的值且必须为空。
216+
dataSource 和 dataSourceRef 之间有三个重要的区别:
182217

183-
* dataSource 仅允许两个特定类型的对象,而 dataSourceRef 允许设置任何非核心对象以及 PersistentVolumeClaim 对象。
184-
185-
* dataSource 忽略不允许的值(这类值会被丢弃),dataSourceRef 保留所有值并在指定不允许的值时产生错误。
186-
187-
(Beta)使用此字段需要启用 AnyVolumeDataSource 特性门控。
218+
<!--
219+
* While dataSource only allows two specific types of objects, dataSourceRef
220+
allows any non-core object, as well as PersistentVolumeClaim objects.
221+
* While dataSource ignores disallowed values (dropping them), dataSourceRef
222+
preserves all values, and generates an error if a disallowed value is
223+
specified.
224+
* While dataSource only allows local objects, dataSourceRef allows objects
225+
in any namespaces.
226+
(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
227+
-->
228+
* dataSource 仅允许两个特定类型的对象,而 dataSourceRef 允许任何非核心对象以及 PersistentVolumeClaim 对象。
229+
* dataSource 忽略不允许的值(这类值会被丢弃),而 dataSourceRef 保留所有值并在指定不允许的值时产生错误。
230+
* dataSource 仅允许本地对象,而 dataSourceRef 允许任意名字空间中的对象。
231+
232+
(Beta) 使用此字段需要启用 AnyVolumeDataSource 特性门控。
233+
(Alpha) 使用 dataSourceRef 的名字空间字段需要启用 CrossNamespaceVolumeDataSource 特性门控。
234+
235+
<a name="TypedObjectReference"></a>
236+
**
237+
238+
<!--
239+
- **dataSourceRef.kind** (string), required
240+
241+
Kind is the type of resource being referenced
242+
243+
- **dataSourceRef.name** (string), required
244+
245+
Name is the name of resource being referenced
246+
-->
247+
- **dataSourceRef.kind** (string),必需
248+
249+
kind 是正被引用的资源的类型。
250+
251+
- **dataSourceRef.name** (string),必需
252+
253+
name 是正被引用的资源的名称。
254+
255+
<!--
256+
- **dataSourceRef.apiGroup** (string)
257+
258+
APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
259+
260+
- **dataSourceRef.namespace** (string)
261+
262+
Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
263+
-->
264+
- **dataSourceRef.apiGroup** (string)
265+
266+
apiGroup 是正被引用的资源的组。如果 apiGroup 未被指定,则指定的 kind 必须在核心 API 组中。
267+
对于任何第三方类型,apiGroup 是必需的。
268+
269+
- **dataSourceRef.namespace** (string)
270+
271+
namespace 是正被引用的资源的名字空间。请注意,当指定一个名字空间时,
272+
在引用的名字空间中 gateway.networking.k8s.io/ReferenceGrant 对象是必需的,
273+
以允许该名字空间的所有者接受引用。有关详细信息,请参阅 ReferenceGrant 文档。
274+
(Alpha) 此字段需要启用 CrossNamespaceVolumeDataSource 特性门控。
188275

189276
## PersistentVolumeClaimStatus {#PersistentVolumeClaimStatus}
190277
<!--

0 commit comments

Comments
 (0)