rebase: update replaced k8s.io modules to v0.33.0

Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
Niels de Vos
2025-05-07 13:13:33 +02:00
committed by mergify[bot]
parent dd77e72800
commit 107407b44b
1723 changed files with 65035 additions and 175239 deletions

View File

@ -62,6 +62,8 @@ message AllocatedDeviceStatus {
// If the device has been configured according to the class and claim
// config references, the `Ready` condition should be True.
//
// Must not contain more than 8 entries.
//
// +optional
// +listType=map
// +listMapKey=type
@ -111,6 +113,64 @@ message BasicDevice {
//
// +optional
map<string, .k8s.io.apimachinery.pkg.api.resource.Quantity> capacity = 2;
// ConsumesCounters defines a list of references to sharedCounters
// and the set of counters that the device will
// consume from those counter sets.
//
// There can only be a single entry per counterSet.
//
// The total number of device counter consumption entries
// must be <= 32. In addition, the total number in the
// entire ResourceSlice must be <= 1024 (for example,
// 64 devices with 16 counters each).
//
// +optional
// +listType=atomic
// +featureGate=DRAPartitionableDevices
repeated DeviceCounterConsumption consumesCounters = 3;
// NodeName identifies the node where the device is available.
//
// Must only be set if Spec.PerDeviceNodeSelection is set to true.
// At most one of NodeName, NodeSelector and AllNodes can be set.
//
// +optional
// +oneOf=DeviceNodeSelection
// +featureGate=DRAPartitionableDevices
optional string nodeName = 4;
// NodeSelector defines the nodes where the device is available.
//
// Must only be set if Spec.PerDeviceNodeSelection is set to true.
// At most one of NodeName, NodeSelector and AllNodes can be set.
//
// +optional
// +oneOf=DeviceNodeSelection
// +featureGate=DRAPartitionableDevices
optional .k8s.io.api.core.v1.NodeSelector nodeSelector = 5;
// AllNodes indicates that all nodes have access to the device.
//
// Must only be set if Spec.PerDeviceNodeSelection is set to true.
// At most one of NodeName, NodeSelector and AllNodes can be set.
//
// +optional
// +oneOf=DeviceNodeSelection
// +featureGate=DRAPartitionableDevices
optional bool allNodes = 6;
// If specified, these are the driver-defined taints.
//
// The maximum number of taints is 4.
//
// This is an alpha field and requires enabling the DRADeviceTaints
// feature gate.
//
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
repeated DeviceTaint taints = 7;
}
// CELDeviceSelector contains a CEL expression for selecting a device.
@ -170,6 +230,42 @@ message CELDeviceSelector {
optional string expression = 1;
}
// Counter describes a quantity associated with a device.
message Counter {
// Value defines how much of a certain device counter is available.
//
// +required
optional .k8s.io.apimachinery.pkg.api.resource.Quantity value = 1;
}
// CounterSet defines a named set of counters
// that are available to be used by devices defined in the
// ResourceSlice.
//
// The counters are not allocatable by themselves, but
// can be referenced by devices. When a device is allocated,
// the portion of counters it uses will no longer be available for use
// by other devices.
message CounterSet {
// CounterSet is the name of the set from which the
// counters defined will be consumed.
//
// +required
optional string name = 1;
// Counters defines the counters that will be consumed by the device.
// The name of each counter must be unique in that set and must be a DNS label.
//
// To ensure this uniqueness, capacities defined by the vendor
// must be listed without the driver name as domain prefix in
// their name. All others must be listed with their domain prefix.
//
// The maximum number of counters is 32.
//
// +required
map<string, Counter> counters = 2;
}
// Device represents one individual hardware instance that can be selected based
// on its attributes. Besides the name, exactly one field must be set.
message Device {
@ -198,6 +294,10 @@ message DeviceAllocationConfiguration {
// Requests lists the names of requests where the configuration applies.
// If empty, its applies to all requests.
//
// References to subrequests must include the name of the main request
// and may include the subrequest using the format <main request>[/<subrequest>]. If just
// the main request is given, the configuration applies to all subrequests.
//
// +optional
// +listType=atomic
repeated string requests = 2;
@ -284,6 +384,10 @@ message DeviceClaimConfiguration {
// Requests lists the names of requests where the configuration applies.
// If empty, it applies to all requests.
//
// References to subrequests must include the name of the main request
// and may include the subrequest using the format <main request>[/<subrequest>]. If just
// the main request is given, the configuration applies to all subrequests.
//
// +optional
// +listType=atomic
repeated string requests = 1;
@ -368,6 +472,10 @@ message DeviceConstraint {
// constraint. If this is not specified, this constraint applies to all
// requests in this claim.
//
// References to subrequests must include the name of the main request
// and may include the subrequest using the format <main request>[/<subrequest>]. If just
// the main request is given, the constraint applies to all subrequests.
//
// +optional
// +listType=atomic
repeated string requests = 1;
@ -390,14 +498,30 @@ message DeviceConstraint {
optional string matchAttribute = 2;
}
// DeviceCounterConsumption defines a set of counters that
// a device will consume from a CounterSet.
message DeviceCounterConsumption {
// CounterSet defines the set from which the
// counters defined will be consumed.
//
// +required
optional string counterSet = 1;
// Counters defines the Counter that will be consumed by
// the device.
//
// The maximum number counters in a device is 32.
// In addition, the maximum number of all counters
// in all devices is 1024 (for example, 64 devices with
// 16 counters each).
//
// +required
map<string, Counter> counters = 2;
}
// DeviceRequest is a request for devices required for a claim.
// This is typically a request for a single resource like a device, but can
// also ask for several identical devices.
//
// A DeviceClassName is currently required. Clients must check that it is
// indeed set. It's absence indicates that something changed in a way that
// is not supported by the client yet, in which case it must refuse to
// handle the request.
message DeviceRequest {
// Name can be used to reference this request in a pod.spec.containers[].resources.claims
// entry and in a constraint of the claim.
@ -411,7 +535,10 @@ message DeviceRequest {
// additional configuration and selectors to be inherited by this
// request.
//
// A class is required. Which classes are available depends on the cluster.
// A class is required if no subrequests are specified in the
// firstAvailable list and no class can be set if subrequests
// are specified in the firstAvailable list.
// Which classes are available depends on the cluster.
//
// Administrators may use this to restrict which devices may get
// requested by only installing classes with selectors for permitted
@ -419,7 +546,8 @@ message DeviceRequest {
// then administrators can create an empty DeviceClass for users
// to reference.
//
// +required
// +optional
// +oneOf=deviceRequestType
optional string deviceClassName = 2;
// Selectors define criteria which must be satisfied by a specific
@ -427,6 +555,9 @@ message DeviceRequest {
// request. All selectors must be satisfied for a device to be
// considered.
//
// This field can only be set when deviceClassName is set and no subrequests
// are specified in the firstAvailable list.
//
// +optional
// +listType=atomic
repeated DeviceSelector selectors = 3;
@ -439,13 +570,17 @@ message DeviceRequest {
// count field.
//
// - All: This request is for all of the matching devices in a pool.
// At least one device must exist on the node for the allocation to succeed.
// Allocation will fail if some devices are already allocated,
// unless adminAccess is requested.
//
// If AlloctionMode is not specified, the default mode is ExactCount. If
// If AllocationMode is not specified, the default mode is ExactCount. If
// the mode is ExactCount and count is not specified, the default count is
// one. Any other requests must specify this field.
//
// This field can only be set when deviceClassName is set and no subrequests
// are specified in the firstAvailable list.
//
// More modes may get added in the future. Clients must refuse to handle
// requests with unknown modes.
//
@ -455,6 +590,9 @@ message DeviceRequest {
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
// If AllocationMode is ExactCount and this field is not specified, the default is one.
//
// This field can only be set when deviceClassName is set and no subrequests
// are specified in the firstAvailable list.
//
// +optional
// +oneOf=AllocationMode
optional int64 count = 5;
@ -465,6 +603,9 @@ message DeviceRequest {
// all ordinary claims to the device with respect to access modes and
// any resource allocations.
//
// This field can only be set when deviceClassName is set and no subrequests
// are specified in the firstAvailable list.
//
// This is an alpha field and requires enabling the DRAAdminAccess
// feature gate. Admin access is disabled if this field is unset or
// set to false, otherwise it is enabled.
@ -472,13 +613,65 @@ message DeviceRequest {
// +optional
// +featureGate=DRAAdminAccess
optional bool adminAccess = 6;
// FirstAvailable contains subrequests, of which exactly one will be
// satisfied by the scheduler to satisfy this request. It tries to
// satisfy them in the order in which they are listed here. So if
// there are two entries in the list, the scheduler will only check
// the second one if it determines that the first one cannot be used.
//
// This field may only be set in the entries of DeviceClaim.Requests.
//
// DRA does not yet implement scoring, so the scheduler will
// select the first set of devices that satisfies all the
// requests in the claim. And if the requirements can
// be satisfied on more than one node, other scheduling features
// will determine which node is chosen. This means that the set of
// devices allocated to a claim might not be the optimal set
// available to the cluster. Scoring will be implemented later.
//
// +optional
// +oneOf=deviceRequestType
// +listType=atomic
// +featureGate=DRAPrioritizedList
repeated DeviceSubRequest firstAvailable = 7;
// If specified, the request's tolerations.
//
// Tolerations for NoSchedule are required to allocate a
// device which has a taint with that effect. The same applies
// to NoExecute.
//
// In addition, should any of the allocated devices get tainted
// with NoExecute after allocation and that effect is not tolerated,
// then all pods consuming the ResourceClaim get deleted to evict
// them. The scheduler will not let new pods reserve the claim while
// it has these tainted devices. Once all pods are evicted, the
// claim will get deallocated.
//
// The maximum number of tolerations is 16.
//
// This field can only be set when deviceClassName is set and no subrequests
// are specified in the firstAvailable list.
//
// This is an alpha field and requires enabling the DRADeviceTaints
// feature gate.
//
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
repeated DeviceToleration tolerations = 8;
}
// DeviceRequestAllocationResult contains the allocation result for one request.
message DeviceRequestAllocationResult {
// Request is the name of the request in the claim which caused this
// device to be allocated. Multiple devices may have been allocated
// per request.
// device to be allocated. If it references a subrequest in the
// firstAvailable list on a DeviceRequest, this field must
// include both the name of the main request and the subrequest
// using the format <main request>/<subrequest>.
//
// Multiple devices may have been allocated per request.
//
// +required
optional string request = 1;
@ -519,6 +712,19 @@ message DeviceRequestAllocationResult {
// +optional
// +featureGate=DRAAdminAccess
optional bool adminAccess = 5;
// A copy of all tolerations specified in the request at the time
// when the device got allocated.
//
// The maximum number of tolerations is 16.
//
// This is an alpha field and requires enabling the DRADeviceTaints
// feature gate.
//
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
repeated DeviceToleration tolerations = 6;
}
// DeviceSelector must have exactly one field set.
@ -530,6 +736,262 @@ message DeviceSelector {
optional CELDeviceSelector cel = 1;
}
// DeviceSubRequest describes a request for device provided in the
// claim.spec.devices.requests[].firstAvailable array. Each
// is typically a request for a single resource like a device, but can
// also ask for several identical devices.
//
// DeviceSubRequest is similar to Request, but doesn't expose the AdminAccess
// or FirstAvailable fields, as those can only be set on the top-level request.
// AdminAccess is not supported for requests with a prioritized list, and
// recursive FirstAvailable fields are not supported.
message DeviceSubRequest {
// Name can be used to reference this subrequest in the list of constraints
// or the list of configurations for the claim. References must use the
// format <main request>/<subrequest>.
//
// Must be a DNS label.
//
// +required
optional string name = 1;
// DeviceClassName references a specific DeviceClass, which can define
// additional configuration and selectors to be inherited by this
// subrequest.
//
// A class is required. Which classes are available depends on the cluster.
//
// Administrators may use this to restrict which devices may get
// requested by only installing classes with selectors for permitted
// devices. If users are free to request anything without restrictions,
// then administrators can create an empty DeviceClass for users
// to reference.
//
// +required
optional string deviceClassName = 2;
// Selectors define criteria which must be satisfied by a specific
// device in order for that device to be considered for this
// request. All selectors must be satisfied for a device to be
// considered.
//
// +optional
// +listType=atomic
repeated DeviceSelector selectors = 3;
// AllocationMode and its related fields define how devices are allocated
// to satisfy this request. Supported values are:
//
// - ExactCount: This request is for a specific number of devices.
// This is the default. The exact number is provided in the
// count field.
//
// - All: This request is for all of the matching devices in a pool.
// Allocation will fail if some devices are already allocated,
// unless adminAccess is requested.
//
// If AllocationMode is not specified, the default mode is ExactCount. If
// the mode is ExactCount and count is not specified, the default count is
// one. Any other requests must specify this field.
//
// More modes may get added in the future. Clients must refuse to handle
// requests with unknown modes.
//
// +optional
optional string allocationMode = 4;
// Count is used only when the count mode is "ExactCount". Must be greater than zero.
// If AllocationMode is ExactCount and this field is not specified, the default is one.
//
// +optional
// +oneOf=AllocationMode
optional int64 count = 5;
// If specified, the request's tolerations.
//
// Tolerations for NoSchedule are required to allocate a
// device which has a taint with that effect. The same applies
// to NoExecute.
//
// In addition, should any of the allocated devices get tainted
// with NoExecute after allocation and that effect is not tolerated,
// then all pods consuming the ResourceClaim get deleted to evict
// them. The scheduler will not let new pods reserve the claim while
// it has these tainted devices. Once all pods are evicted, the
// claim will get deallocated.
//
// The maximum number of tolerations is 16.
//
// This is an alpha field and requires enabling the DRADeviceTaints
// feature gate.
//
// +optional
// +listType=atomic
// +featureGate=DRADeviceTaints
repeated DeviceToleration tolerations = 7;
}
// 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.
message DeviceTaint {
// The taint key to be applied to a device.
// Must be a label name.
//
// +required
optional string key = 1;
// The taint value corresponding to the taint key.
// Must be a label value.
//
// +optional
optional string value = 2;
// The 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.
//
// +required
optional string effect = 3;
// TimeAdded represents the time at which the taint was added.
// Added automatically during create or update if not set.
//
// +optional
optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time timeAdded = 4;
}
// DeviceTaintRule 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.
message DeviceTaintRule {
// Standard object metadata
// +optional
optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec specifies the selector and one taint.
//
// Changing the spec automatically increments the metadata.generation number.
optional DeviceTaintRuleSpec spec = 2;
}
// DeviceTaintRuleList is a collection of DeviceTaintRules.
message DeviceTaintRuleList {
// Standard list metadata
// +optional
optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of DeviceTaintRules.
repeated DeviceTaintRule items = 2;
}
// DeviceTaintRuleSpec specifies the selector and one taint.
message DeviceTaintRuleSpec {
// DeviceSelector defines which device(s) the taint is applied to.
// All selector criteria must be satified for a device to
// match. The empty selector matches all devices. Without
// a selector, no devices are matches.
//
// +optional
optional DeviceTaintSelector deviceSelector = 1;
// The taint that gets applied to matching devices.
//
// +required
optional DeviceTaint taint = 2;
}
// DeviceTaintSelector defines which device(s) a DeviceTaintRule applies to.
// The empty selector matches all devices. Without a selector, no devices
// are matched.
message DeviceTaintSelector {
// If DeviceClassName is set, the selectors defined there must be
// satisfied by a device to be selected. This field corresponds
// to class.metadata.name.
//
// +optional
optional string deviceClassName = 1;
// If driver is set, only devices from that driver are selected.
// This fields corresponds to slice.spec.driver.
//
// +optional
optional string driver = 2;
// 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.
//
// +optional
optional string pool = 3;
// 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.
//
// +optional
optional string device = 4;
// Selectors contains the same selection criteria as a ResourceClaim.
// Currently, CEL expressions are supported. All of these selectors
// must be satisfied.
//
// +optional
// +listType=atomic
repeated DeviceSelector selectors = 5;
}
// The ResourceClaim this DeviceToleration is attached to tolerates any taint that matches
// the triple <key,value,effect> using the matching operator <operator>.
message DeviceToleration {
// Key is the taint key that the toleration applies to. Empty means match all taint keys.
// If the key is empty, operator must be Exists; this combination means to match all values and all keys.
// Must be a label name.
//
// +optional
optional string key = 1;
// Operator represents a key's relationship to the value.
// Valid operators are Exists and Equal. Defaults to Equal.
// Exists is equivalent to wildcard for value, so that a ResourceClaim can
// tolerate all taints of a particular category.
//
// +optional
// +default="Equal"
optional string operator = 2;
// Value is the taint value the toleration matches to.
// If the operator is Exists, the value must be empty, otherwise just a regular string.
// Must be a label value.
//
// +optional
optional string value = 3;
// Effect indicates the taint effect to match. Empty means match all taint effects.
// When specified, allowed values are NoSchedule and NoExecute.
//
// +optional
optional string effect = 4;
// TolerationSeconds represents the period of time the toleration (which must be
// of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
// it is not set, which means tolerate the taint forever (do not evict). Zero and
// negative values will be treated as 0 (evict immediately) by the system.
// If larger than zero, the time when the pod needs to be evicted is calculated as <time when
// taint was adedd> + <toleration seconds>.
//
// +optional
optional int64 tolerationSeconds = 5;
}
// NetworkDeviceData provides network-related details for the allocated device.
// This information may be filled by drivers or other components to configure
// or identify the device within a network context.
@ -549,6 +1011,8 @@ message NetworkDeviceData {
// associated subnet mask.
// e.g.: "192.0.2.5/24" for IPv4 and "2001:db8::5/64" for IPv6.
//
// Must not contain more than 16 entries.
//
// +optional
// +listType=atomic
repeated string ips = 2;
@ -847,7 +1311,7 @@ message ResourceSliceSpec {
// new nodes of the same type as some old node might also make new
// resources available.
//
// Exactly one of NodeName, NodeSelector and AllNodes must be set.
// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
// This field is immutable.
//
// +optional
@ -859,7 +1323,7 @@ message ResourceSliceSpec {
//
// Must use exactly one term.
//
// Exactly one of NodeName, NodeSelector and AllNodes must be set.
// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
//
// +optional
// +oneOf=NodeSelection
@ -867,7 +1331,7 @@ message ResourceSliceSpec {
// AllNodes indicates that all nodes have access to the resources in the pool.
//
// Exactly one of NodeName, NodeSelector and AllNodes must be set.
// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
//
// +optional
// +oneOf=NodeSelection
@ -880,5 +1344,29 @@ message ResourceSliceSpec {
// +optional
// +listType=atomic
repeated Device devices = 6;
// PerDeviceNodeSelection defines whether the access from nodes to
// resources in the pool is set on the ResourceSlice level or on each
// device. If it is set to true, every device defined the ResourceSlice
// must specify this individually.
//
// Exactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.
//
// +optional
// +oneOf=NodeSelection
// +featureGate=DRAPartitionableDevices
optional bool perDeviceNodeSelection = 7;
// SharedCounters defines a list of counter sets, each of which
// has a name and a list of counters available.
//
// The names of the SharedCounters must be unique in the ResourceSlice.
//
// The maximum number of SharedCounters is 32.
//
// +optional
// +listType=atomic
// +featureGate=DRAPartitionableDevices
repeated CounterSet sharedCounters = 8;
}