You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/zh-cn/docs/reference/kubernetes-api/extend-resources/device-class-v1.md
+59-42Lines changed: 59 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,14 +28,10 @@ auto_generated: true
28
28
29
29
<!--
30
30
DeviceClass is a vendor- or admin-provided resource that contains device configuration and selectors. It can be referenced in the device requests of a claim to apply these presets. Cluster scoped.
31
-
32
-
This is an alpha type and requires enabling the DynamicResourceAllocation feature gate.
ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.
The device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.
325
-
321
+
326
322
The value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.
If an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.
337
-
333
+
338
334
A robust expression should check for the existence of attributes before referencing them.
339
335
340
336
For ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:
When the DRAListTypeAttributes feature gate is enabled, the includes() helper is available and it can work for both scalar and list-type attributes. It was introduced to support smooth migration from scalar attributes to list-type attributes while keeping CEL expressions simple. For example:
The length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps.
@@ -389,17 +397,16 @@ DeviceClassList 是类的集合。
389
397
390
398
<!--
391
399
## Operations {#Operations}
400
+
-->
401
+
## 操作 {#Operations}
392
402
393
403
<hr>
394
404
405
+
<!--
395
406
### `get` read the specified DeviceClass
396
407
397
408
#### HTTP Request
398
409
-->
399
-
## 操作 {#Operations}
400
-
401
-
<hr>
402
-
403
410
### `get` 读取指定的 DeviceClass
404
411
405
412
#### HTTP 请求
@@ -440,17 +447,16 @@ GET /apis/resource.k8s.io/v1/deviceclasses/{name}
440
447
### `list` list or watch objects of kind DeviceClass
441
448
442
449
#### HTTP Request
443
-
444
-
GET /apis/resource.k8s.io/v1/deviceclasses
445
-
446
-
#### Parameters
447
450
-->
448
451
### `list` 列举或监视 DeviceClass 类别的对象
449
452
450
453
#### HTTP 请求
451
454
452
455
GET /apis/resource.k8s.io/v1/deviceclasses
453
456
457
+
<!--
458
+
#### Parameters
459
+
-->
454
460
#### 参数
455
461
456
462
<!--
@@ -490,6 +496,10 @@ GET /apis/resource.k8s.io/v1/deviceclasses
0 commit comments