DeviceTaintRule v1alpha3
apiVersion: resource.k8s.io/v1alpha3
import "k8s.io/api/resource/v1alpha3"
DeviceTaintRule
DeviceTaintRule 为所有匹配选择器的设备添加一个污点。这与 DRA 驱动程序直接在 ResourceSlice 中指定污点具有相同的效果。
apiVersion: resource.k8s.io/v1alpha3
kind: DeviceTaintRule
metadata (ObjectMeta)
标准对象元数据
spec (DeviceTaintRuleSpec), 必填
Spec 指定选择器和一个污点。
更改 spec 会自动增加 metadata.generation 的值。
DeviceTaintRuleSpec
DeviceTaintRuleSpec 指定选择器和一个污点。
taint (DeviceTaint), 必填
应用于匹配设备的污点。
此污点所附着的设备会对任何不容忍此污点的声明产生“影响”,并通过该声明影响使用该声明的 Pod。
taint.effect (字符串), 必填
污点对不容忍此污点的声明,以及通过此类声明对使用它们的 Pod 产生的影响。有效的影响为 NoSchedule 和 NoExecute。在此处,用于节点的 PreferNoSchedule 无效。
taint.key (字符串), 必填
要应用于设备的污点键。必须是标签名称。
taint.timeAdded (时间)
TimeAdded 表示添加污点的时间。如果未设置,则在创建或更新期间自动添加。
Time 是 time.Time 的一个包装器,支持正确地编组到 YAML 和 JSON。提供了 time 包提供的许多工厂方法的包装器。
taint.value (字符串)
污点键对应的污点值。必须是标签值。
deviceSelector (DeviceTaintSelector)
DeviceSelector 定义污点应用于哪些设备。设备必须满足所有选择器条件才能匹配。空选择器匹配所有设备。如果没有选择器,则不匹配任何设备。
DeviceTaintSelector 定义 DeviceTaintRule 适用于哪些设备。空选择器匹配所有设备。如果没有选择器,则不匹配任何设备。
deviceSelector.device (字符串)
如果设置了 device,则仅选择具有该名称的设备。此字段对应于 slice.spec.devices[].name。
可能还需要同时设置 driver 和 pool 以避免歧义,但这不是必需的。
deviceSelector.deviceClassName (字符串)
如果设置了 DeviceClassName,则设备必须满足其中定义的选择器才能被选中。此字段对应于 class.metadata.name。
deviceSelector.driver (字符串)
如果设置了 driver,则仅选择来自该驱动程序的设备。此字段对应于 slice.spec.driver。
deviceSelector.pool (字符串)
如果设置了 pool,则仅选择该池中的设备。
同时设置驱动程序名称可能有助于避免当不同驱动程序使用相同的池名称时出现歧义,但这不是必需的,因为选择来自不同驱动程序的池也可能有用,例如当具有节点本地设备的驱动程序使用节点名称作为其池名称时。
deviceSelector.selectors ([]DeviceSelector)
原子性:在合并期间将被替换
Selectors 包含与 ResourceClaim 相同的选择标准。目前支持 CEL 表达式。所有这些选择器都必须满足。
deviceSelector.selectors.cel (CELDeviceSelector)
CEL 包含用于选择设备的 CEL 表达式。
CELDeviceSelector 包含用于选择设备的 CEL 表达式。
deviceSelector.selectors.cel.expression (字符串), 必填
Expression 是一个评估单个设备的 CEL 表达式。当所考虑的设备满足所需条件时,它必须评估为 true,否则评估为 false。任何其他结果都是错误,并导致设备分配中止。
表达式的输入是一个名为 "device" 的对象,它具有以下属性:
- driver (字符串): 定义此设备的驱动程序名称。
- attributes (map[string]object): 设备的属性,按前缀分组(例如 device.attributes["dra.example.com"] 评估为一个包含所有以 "dra.example.com" 为前缀的属性的对象)。
- capacity (map[string]object): 设备的容量,按前缀分组。
示例:考虑一个驱动程序为 "dra.example.com" 的设备,它暴露了名为 "model" 和 "ext.example.com/family" 的两个属性,并暴露了一个名为 "modules" 的容量。此表达式的输入将具有以下字段:
device.driver device.attributes["dra.example.com"].model device.attributes["ext.example.com"].family device.capacity["dra.example.com"].modules
device.driver 字段可用于检查特定驱动程序,既可以作为高级前置条件(即您只想考虑来自此驱动程序的设备),也可以作为旨在考虑来自不同驱动程序的设备的多子句表达式的一部分。
每个属性的值类型由设备定义确定,编写这些表达式的用户必须查阅其特定驱动程序的文档。每个容量的值类型为 Quantity。
如果在 device.attributes 或 device.capacity 中使用未知前缀进行查找,将返回一个空映射。任何对未知字段的引用都将导致评估错误并中止分配。
健壮的表达式应在引用属性之前检查它们是否存在。
为了便于使用,cel.bind() 函数已启用,可用于简化访问具有相同域的多个属性的表达式。例如:
cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool)
表达式的长度必须小于或等于 10 Ki。评估成本也根据估计的逻辑步骤数受到限制。
DeviceTaintRuleList
DeviceTaintRuleList 是 DeviceTaintRule 的集合。
apiVersion: resource.k8s.io/v1alpha3
kind: DeviceTaintRuleList
metadata (ListMeta)
标准列表元数据
items ([]DeviceTaintRule), 必填
Items 是 DeviceTaintRule 的列表。
操作
get
读取指定的 DeviceTaintRule
HTTP 请求
GET /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}
参数
name (在路径中): string,必填
DeviceTaintRule 的名称
pretty (在查询中): string
响应
200 (DeviceTaintRule): 成功
401: 未授权
list
列出或监视 DeviceTaintRule 类型的对象
HTTP 请求
GET /apis/resource.k8s.io/v1alpha3/devicetaintrules
参数
allowWatchBookmarks (在查询中): boolean
continue (在查询中): string
fieldSelector (在查询中): string
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
watch (在查询中): boolean
响应
200 (DeviceTaintRuleList): 成功
401: 未授权
create
创建 DeviceTaintRule
HTTP 请求
POST /apis/resource.k8s.io/v1alpha3/devicetaintrules
参数
body: DeviceTaintRule, 必填
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (DeviceTaintRule): 成功
201 (DeviceTaintRule): 已创建
202 (DeviceTaintRule): 已接受
401: 未授权
update
替换指定的 DeviceTaintRule
HTTP 请求
PUT /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}
参数
name (在路径中): string,必填
DeviceTaintRule 的名称
body: DeviceTaintRule, 必填
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (DeviceTaintRule): 成功
201 (DeviceTaintRule): 已创建
401: 未授权
patch
部分更新指定的 DeviceTaintRule
HTTP 请求
PATCH /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}
参数
name (在路径中): string,必填
DeviceTaintRule 的名称
body: Patch,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (在查询中): boolean
pretty (在查询中): string
响应
200 (DeviceTaintRule): 成功
201 (DeviceTaintRule): 已创建
401: 未授权
delete
删除 DeviceTaintRule
HTTP 请求
DELETE /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}
参数
name (在路径中): string,必填
DeviceTaintRule 的名称
body: DeleteOptions
dryRun (在查询中): string
gracePeriodSeconds (在查询中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查询中): boolean
pretty (在查询中): string
propagationPolicy (在查询中): string
响应
200 (DeviceTaintRule): 成功
202 (DeviceTaintRule): 已接受
401: 未授权
deletecollection
删除 DeviceTaintRule 集合
HTTP 请求
DELETE /apis/resource.k8s.io/v1alpha3/devicetaintrules
参数
body: DeleteOptions
continue (在查询中): string
dryRun (在查询中): string
fieldSelector (在查询中): string
gracePeriodSeconds (在查询中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查询中): boolean
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
propagationPolicy (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
响应
200 (Status): OK
401: 未授权
本页面是自动生成的。
如果你打算报告此页面存在的问题,请在问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。