458 lines
16 KiB
Protocol Buffer
458 lines
16 KiB
Protocol Buffer
/*
|
|
Copyright The Kubernetes Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
|
|
// This file was autogenerated by go-to-protobuf. Do not edit it manually!
|
|
|
|
syntax = "proto2";
|
|
|
|
package k8s.io.api.resource.v1alpha3;
|
|
|
|
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
|
|
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
|
|
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
|
|
|
|
// Package-wide variables from generator "generated".
|
|
option go_package = "k8s.io/api/resource/v1alpha3";
|
|
|
|
// CELDeviceSelector contains a CEL expression for selecting a device.
|
|
message CELDeviceSelector {
|
|
// Expression 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.
|
|
//
|
|
// +required
|
|
optional string expression = 1;
|
|
}
|
|
|
|
// DeviceSelector must have exactly one field set.
|
|
message DeviceSelector {
|
|
// CEL contains a CEL expression for selecting a device.
|
|
//
|
|
// +optional
|
|
// +oneOf=SelectorType
|
|
optional CELDeviceSelector cel = 1;
|
|
}
|
|
|
|
// 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.
|
|
//
|
|
// +protobuf.options.(gogoproto.goproto_stringer)=false
|
|
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 None, NoSchedule and NoExecute. PreferNoSchedule as used for
|
|
// nodes is not valid here. More effects may get added in the future.
|
|
// Consumers must treat unknown effects like None.
|
|
//
|
|
// +required
|
|
// +k8s:required
|
|
optional string effect = 3;
|
|
|
|
// TimeAdded represents the time at which the taint was added or
|
|
// (only in a DeviceTaintRule) the effect was modified.
|
|
// Added automatically during create or update if not set.
|
|
//
|
|
// In addition, in a DeviceTaintRule a value provided during
|
|
// an update gets replaced with the current time if the provided
|
|
// value is the same as the old one and the new effect is different.
|
|
// Changing the key and/or value while keeping the effect unchanged
|
|
// is possible and does not update the time stamp because the eviction
|
|
// which uses it is either already started (NoExecute) or
|
|
// not started yet (NoEffect, NoSchedule).
|
|
//
|
|
// +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.
|
|
// +required
|
|
optional DeviceTaintRuleSpec spec = 2;
|
|
|
|
// Status provides information about what was requested in the spec.
|
|
//
|
|
// +optional
|
|
optional DeviceTaintRuleStatus status = 3;
|
|
}
|
|
|
|
// 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 satisfied 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;
|
|
}
|
|
|
|
// DeviceTaintRuleStatus provides information about an on-going pod eviction.
|
|
message DeviceTaintRuleStatus {
|
|
// Conditions provide information about the state of the DeviceTaintRule
|
|
// and the cluster at some point in time,
|
|
// in a machine-readable and human-readable format.
|
|
//
|
|
// The following condition is currently defined as part of this API, more may
|
|
// get added:
|
|
// - Type: EvictionInProgress
|
|
// - Status: True if there are currently pods which need to be evicted, False otherwise
|
|
// (includes the effects which don't cause eviction).
|
|
// - Reason: not specified, may change
|
|
// - Message: includes information about number of pending pods and already evicted pods
|
|
// in a human-readable format, updated periodically, may change
|
|
//
|
|
// For `effect: None`, the condition above gets set once for each change to
|
|
// the spec, with the message containing information about what would happen
|
|
// if the effect was `NoExecute`. This feedback can be used to decide whether
|
|
// changing the effect to `NoExecute` will work as intended. It only gets
|
|
// set once to avoid having to constantly update the status.
|
|
//
|
|
// Must have 8 or fewer entries.
|
|
//
|
|
// +optional
|
|
// +listType=map
|
|
// +listMapKey=type
|
|
// +patchStrategy=merge
|
|
// +patchMergeKey=type
|
|
repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1;
|
|
}
|
|
|
|
// 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 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;
|
|
}
|
|
|
|
// PoolStatus contains status information for a single resource pool.
|
|
message PoolStatus {
|
|
// Driver is the DRA driver name for this pool.
|
|
// Must be a DNS subdomain (e.g., "gpu.example.com").
|
|
//
|
|
// +required
|
|
// +k8s:required
|
|
// +k8s:format=k8s-long-name-caseless
|
|
optional string driver = 1;
|
|
|
|
// PoolName is the name of the pool.
|
|
// Must be a valid resource pool name (DNS subdomains separated by "/").
|
|
//
|
|
// +required
|
|
// +k8s:required
|
|
// +k8s:format=k8s-resource-pool-name
|
|
optional string poolName = 2;
|
|
|
|
// Generation is the pool generation observed across all ResourceSlices
|
|
// in this pool. Only the latest generation is reported. During a generation
|
|
// rollout, if not all slices at the latest generation have been published,
|
|
// the pool is included with a validationError and device counts unset.
|
|
//
|
|
// +required
|
|
// +k8s:required
|
|
// +k8s:minimum=0
|
|
optional int64 generation = 9;
|
|
|
|
// ResourceSliceCount is the number of ResourceSlices that make up this pool.
|
|
// May be unset when validationError is set.
|
|
//
|
|
// +optional
|
|
// +k8s:optional
|
|
// +k8s:minimum=1
|
|
optional int32 resourceSliceCount = 8;
|
|
|
|
// TotalDevices is the total number of devices in the pool across all slices.
|
|
// A value of 0 means the pool has no devices.
|
|
// May be unset when validationError is set.
|
|
//
|
|
// +optional
|
|
// +k8s:optional
|
|
// +k8s:minimum=0
|
|
optional int32 totalDevices = 4;
|
|
|
|
// AllocatedDevices is the number of devices currently allocated to claims.
|
|
// A value of 0 means no devices are allocated.
|
|
// May be unset when validationError is set.
|
|
//
|
|
// +optional
|
|
// +k8s:optional
|
|
// +k8s:minimum=0
|
|
optional int32 allocatedDevices = 5;
|
|
|
|
// AvailableDevices is the number of devices available for allocation.
|
|
// This equals TotalDevices - AllocatedDevices - UnavailableDevices.
|
|
// A value of 0 means no devices are currently available.
|
|
// May be unset when validationError is set.
|
|
//
|
|
// +optional
|
|
// +k8s:optional
|
|
// +k8s:minimum=0
|
|
optional int32 availableDevices = 6;
|
|
|
|
// UnavailableDevices is the number of devices that are not available
|
|
// due to taints or other conditions, but are not allocated.
|
|
// A value of 0 means all unallocated devices are available.
|
|
// May be unset when validationError is set.
|
|
//
|
|
// +optional
|
|
// +k8s:optional
|
|
// +k8s:minimum=0
|
|
optional int32 unavailableDevices = 7;
|
|
|
|
// NodeName is the node this pool is associated with.
|
|
// When omitted, the pool is not associated with a specific node.
|
|
// Must be a valid DNS subdomain name (RFC1123).
|
|
//
|
|
// +optional
|
|
// +k8s:optional
|
|
// +k8s:format=k8s-long-name
|
|
optional string nodeName = 3;
|
|
|
|
// ValidationError is set when the pool's data could not be fully
|
|
// validated (e.g., incomplete slice publication). When set, device
|
|
// count fields and ResourceSliceCount may be unset.
|
|
//
|
|
// +optional
|
|
// +k8s:optional
|
|
// +k8s:maxBytes=256
|
|
optional string validationError = 10;
|
|
}
|
|
|
|
// ResourcePoolStatusRequest triggers a one-time calculation of resource pool status
|
|
// based on the provided filters. Once status is set, the request is considered complete and will not be reprocessed.
|
|
// Users should delete and recreate requests to get updated information.
|
|
message ResourcePoolStatusRequest {
|
|
// Standard object metadata
|
|
// +required
|
|
optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
|
|
|
|
// Spec defines the filters for which pools to include in the status.
|
|
// The spec is immutable once created.
|
|
//
|
|
// +required
|
|
// +k8s:immutable
|
|
optional ResourcePoolStatusRequestSpec spec = 2;
|
|
|
|
// Status is populated by the controller with the calculated pool status.
|
|
// When status is non-nil, the request is considered complete and the
|
|
// entire object becomes immutable.
|
|
//
|
|
// +optional
|
|
// +k8s:optional
|
|
optional ResourcePoolStatusRequestStatus status = 3;
|
|
}
|
|
|
|
// ResourcePoolStatusRequestList is a collection of ResourcePoolStatusRequests.
|
|
message ResourcePoolStatusRequestList {
|
|
// Standard list metadata
|
|
// +optional
|
|
optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
|
|
|
|
// Items is the list of ResourcePoolStatusRequests.
|
|
repeated ResourcePoolStatusRequest items = 2;
|
|
}
|
|
|
|
// ResourcePoolStatusRequestSpec defines the filters for the pool status request.
|
|
message ResourcePoolStatusRequestSpec {
|
|
// Driver specifies the DRA driver name to filter pools.
|
|
// Only pools from ResourceSlices with this driver will be included.
|
|
// Must be a DNS subdomain (e.g., "gpu.example.com").
|
|
//
|
|
// +required
|
|
// +k8s:required
|
|
// +k8s:format=k8s-long-name-caseless
|
|
optional string driver = 1;
|
|
|
|
// PoolName optionally filters to a specific pool name.
|
|
// If not specified, all pools from the specified driver are included.
|
|
// When specified, must be a non-empty valid resource pool name
|
|
// (DNS subdomains separated by "/").
|
|
//
|
|
// +optional
|
|
// +k8s:optional
|
|
// +k8s:format=k8s-resource-pool-name
|
|
optional string poolName = 2;
|
|
|
|
// Limit optionally specifies the maximum number of pools to return in the status.
|
|
// If more pools match the filter criteria, the response will be truncated
|
|
// (i.e., len(status.pools) < status.poolCount).
|
|
//
|
|
// Default: 100
|
|
// Minimum: 1
|
|
// Maximum: 1000
|
|
//
|
|
// +optional
|
|
// +k8s:optional
|
|
// +default=100
|
|
// +k8s:minimum=1
|
|
// +k8s:maximum=1000
|
|
optional int32 limit = 3;
|
|
}
|
|
|
|
// ResourcePoolStatusRequestStatus contains the calculated pool status information.
|
|
message ResourcePoolStatusRequestStatus {
|
|
// PoolCount is the total number of pools that matched the filter criteria,
|
|
// regardless of truncation. This helps users understand how many pools exist
|
|
// even when the response is truncated. A value of 0 means no pools matched
|
|
// the filter criteria.
|
|
//
|
|
// +required
|
|
// +k8s:required
|
|
// +k8s:minimum=0
|
|
optional int32 poolCount = 6;
|
|
|
|
// Pools contains the first `spec.limit` matching pools, sorted by driver
|
|
// then pool name. If `len(pools) < poolCount`, the list was truncated.
|
|
// When omitted, no pools matched the request filters.
|
|
//
|
|
// +optional
|
|
// +k8s:optional
|
|
// +listType=atomic
|
|
// +k8s:listType=atomic
|
|
// +k8s:maxItems=1000
|
|
repeated PoolStatus pools = 2;
|
|
|
|
// Conditions provide information about the state of the request.
|
|
// A condition with type=Complete or type=Failed will always be set
|
|
// when the status is populated.
|
|
//
|
|
// Known condition types:
|
|
// - "Complete": True when the request has been processed successfully
|
|
// - "Failed": True when the request could not be processed
|
|
//
|
|
// +optional
|
|
// +k8s:optional
|
|
// +listType=map
|
|
// +k8s:listType=map
|
|
// +listMapKey=type
|
|
// +k8s:listMapKey=type
|
|
// +patchStrategy=merge
|
|
// +patchMergeKey=type
|
|
// +k8s:maxItems=10
|
|
repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 3;
|
|
}
|
|
|