# DeviceTaintRule v1alpha3

DeviceTaintRule v1alpha3DeviceTaintRule adds one taint to all devices which match the selector.apiVersion: resource.k8s.io/v1alpha3import "k8s.io/api/resource/v1alpha3"DeviceTaintRuleDeviceTaintRule adds one taint to all devices which match the selector. This has the same effect as if the taint was specified directly in the ResourceSlice by the DRA driver.apiVersion: resource.k8s.io/v1alpha3kind: DeviceTaintRulemetadata (ObjectMeta)Standard object metadataspec (DeviceTaintRuleSpec), requiredSpec specifies the selector and one taint.Changing the spec automatically increments the metadata.generation number.DeviceTaintRuleSpecDeviceTaintRuleSpec specifies the selector and one taint.taint (DeviceTaint), requiredThe taint that gets applied to matching devices.The device this taint is attached to has the "effect" on any claim which does not tolerate the taint and, through the claim, to pods using the claim.taint.effect (string), requiredThe effect of the taint on claims that do not tolerate the taint and through such claims on the pods using them. Valid effects are NoSchedule and NoExecute. PreferNoSchedule as used for nodes is not valid here.taint.key (string), requiredThe taint key to be applied to a device. Must be a label name.taint.timeAdded (Time)TimeAdded represents the time at which the taint was added. Added automatically during create or update if not set.Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.taint.value (string)The taint value corresponding to the taint key. Must be a label value.deviceSelector (DeviceTaintSelector)DeviceSelector defines which device(s) the taint is applied to. All selector criteria must be satisfied for a device to match. The empty selector matches all devices. Without a selector, no devices are matches.DeviceTaintSelector defines which device(s) a DeviceTaintRule applies to. The empty selector matches all devices. Without a selector, no devices are matched.deviceSelector.device (string)If device is set, only devices with that name are selected. This field corresponds to slice.spec.devices[].name.Setting also driver and pool may be required to avoid ambiguity, but is not required.deviceSelector.deviceClassName (string)If DeviceClassName is set, the selectors defined there must be satisfied by a device to be selected. This field corresponds to class.metadata.name.deviceSelector.driver (string)If driver is set, only devices from that driver are selected. This fields corresponds to slice.spec.driver.deviceSelector.pool (string)If pool is set, only devices in that pool are selected.Also setting the driver name may be useful to avoid ambiguity when different drivers use the same pool name, but this is not required because selecting pools from different drivers may also be useful, for example when drivers with node-local devices use the node name as their pool name.deviceSelector.selectors ([]DeviceSelector)Atomic: will be replaced during a mergeSelectors contains the same selection criteria as a ResourceClaim. Currently, CEL expressions are supported. All of these selectors must be satisfied.DeviceSelector must have exactly one field set.deviceSelector.selectors.cel (CELDeviceSelector)CEL contains a CEL expression for selecting a device.CELDeviceSelector contains a CEL expression for selecting a device.deviceSelector.selectors.cel.expression (string), requiredExpression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.The expression's input is an object named "device", which carries the following properties:driver (string): the name of the driver which defines this device.attributes (map[string]object): the device's attributes, grouped by prefix (e.g. device.attributes["dra.example.com"] evaluates to an object with all of the attributes which were prefixed by "dra.example.com".capacity (map[string]object): the device's capacities, grouped by prefix.Example: Consider a device with driver="dra.example.com", which exposes two attributes named "model" and "ext.example.com/family" and which exposes one capacity named "modules". This input to this expression would have the following fields:device.driver device.attributes["dra.example.com"].model device.attributes["ext.example.com"].family device.capacity["dra.example.com"].modules 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.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.A robust expression should check for the existence of attributes before referencing them.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:cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool) 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.DeviceTaintRuleListDeviceTaintRuleList is a collection of DeviceTaintRules.apiVersion: resource.k8s.io/v1alpha3kind: DeviceTaintRuleListmetadata (ListMeta)Standard list metadataitems ([]DeviceTaintRule), requiredItems is the list of DeviceTaintRules.Operationsget read the specified DeviceTaintRuleHTTP RequestGET /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}Parametersname (in path): string, requiredname of the DeviceTaintRulepretty (in query): stringprettyResponse200 (DeviceTaintRule): OK401: Unauthorizedlist list or watch objects of kind DeviceTaintRuleHTTP RequestGET /apis/resource.k8s.io/v1alpha3/devicetaintrulesParametersallowWatchBookmarks (in query): booleanallowWatchBookmarkscontinue (in query): stringcontinuefieldSelector (in query): stringfieldSelectorlabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondswatch (in query): booleanwatchResponse200 (DeviceTaintRuleList): OK401: Unauthorizedcreate create a DeviceTaintRuleHTTP RequestPOST /apis/resource.k8s.io/v1alpha3/devicetaintrulesParametersbody: DeviceTaintRule, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (DeviceTaintRule): OK201 (DeviceTaintRule): Created202 (DeviceTaintRule): Accepted401: Unauthorizedupdate replace the specified DeviceTaintRuleHTTP RequestPUT /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}Parametersname (in path): string, requiredname of the DeviceTaintRulebody: DeviceTaintRule, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (DeviceTaintRule): OK201 (DeviceTaintRule): Created401: Unauthorizedpatch partially update the specified DeviceTaintRuleHTTP RequestPATCH /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}Parametersname (in path): string, requiredname of the DeviceTaintRulebody: Patch, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationforce (in query): booleanforcepretty (in query): stringprettyResponse200 (DeviceTaintRule): OK201 (DeviceTaintRule): Created401: Unauthorizeddelete delete a DeviceTaintRuleHTTP RequestDELETE /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}Parametersname (in path): string, requiredname of the DeviceTaintRulebody: DeleteOptionsdryRun (in query): stringdryRungracePeriodSeconds (in query): integergracePeriodSecondsignoreStoreReadErrorWithClusterBreakingPotential (in query): booleanignoreStoreReadErrorWithClusterBreakingPotentialpretty (in query): stringprettypropagationPolicy (in query): stringpropagationPolicyResponse200 (DeviceTaintRule): OK202 (DeviceTaintRule): Accepted401: Unauthorizeddeletecollection delete collection of DeviceTaintRuleHTTP RequestDELETE /apis/resource.k8s.io/v1alpha3/devicetaintrulesParametersbody: DeleteOptionscontinue (in query): stringcontinuedryRun (in query): stringdryRunfieldSelector (in query): stringfieldSelectorgracePeriodSeconds (in query): integergracePeriodSecondsignoreStoreReadErrorWithClusterBreakingPotential (in query): booleanignoreStoreReadErrorWithClusterBreakingPotentiallabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettypropagationPolicy (in query): stringpropagationPolicyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondsResponse200 (Status): OK401: UnauthorizedThis page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.