api

package
v0.0.0-...-68051d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CStyleIdentifierMaxLength = 32

CStyleIdentifierMaxLength is the maximum length of a c-style identifier used for naming.

View Source
const DeviceAttributeMaxIDLength = CStyleIdentifierMaxLength

DeviceAttributeMaxIDLength is the maximum length of the identifier in a device attribute name (`<domain>/<ID>`).

View Source
const DeviceAttributeMaxValueLength = 64

DeviceAttributeMaxValueLength is the maximum length of a string or version attribute value.

View Source
const GroupName = "resource.k8s.io"

GroupName is the group name use in this package

View Source
const ResourcePoolMaxAttributesPerDevice = 32
View Source
const ResourcePoolMaxDevices = 128
View Source
const ResourcePoolMaxSharedCapacity = 128
View Source
const ResourcePoolMaxSharedCapacityConsumedPerDevice = 32
View Source
const SharedCapacityMaxNameLength = CStyleIdentifierMaxLength

SharedCapacityMaxNameLength is the maximum length of a shared capacity name.

Variables

View Source
var (
	// We only register manually written functions here. The registration of the
	// generated functions takes place in the generated files. The separation
	// makes the code compile even when the generated files are missing.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"}

SchemeGroupVersion is group version used to register these objects

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type AllocationResult

type AllocationResult struct {
	// DriverData contains the state associated with an allocation that
	// should be maintained throughout the lifetime of a claim. Each
	// entry contains data that should be passed to a specific kubelet
	// plugin once the claim lands on a node.
	//
	// Setting this field is optional. It has a maximum size of 32 entries.
	// If empty, nothing was allocated for the claim and kubelet does not
	// need to prepare anything for it.
	//
	// +listType=atomic
	// +optional
	DriverData []DriverData `json:"driverData,omitempty" protobuf:"bytes,1,opt,name=driverData"`

	// This is the node which provides the allocated devices.
	//
	// If empty, then the devices are not local to one particular node.
	NodeName string `json:"nodeName,omitempty" protobuf:"bytes,2,opt,name=nodeName"`

	// Shareable determines whether the resource supports more
	// than one consumer at a time.
	// +optional
	Shareable bool `json:"shareable,omitempty" protobuf:"varint,3,opt,name=shareable"`
}

AllocationResult contains attributes of an allocated resource.

type ClaimSource

type ClaimSource struct {
	// The ResourceClaim named here is shared by all pods which
	// reference it. The lifecycle of that ResourceClaim is not
	// managed by Kubernetes.
	//
	// +optional
	ResourceClaimName *string `json:"resourceClaimName" protobuf:"bytes,1,opt,name=resourceClaimName"`
	// The ResourceClaimTemplate named here is used to create
	// a per-pod ResourceClaim. It gets deleted automatically
	// together with the pod.
	//
	// +optional
	ResourceClaimTemplateName *string `json:"resourceClaimTemplateName" protobuf:"bytes,2,opt,name=resourceClaimTemplateName"`
}

ClaimSource must have one and only one field set.

type ConfigurationParameters

type ConfigurationParameters struct {
	Opaque *OpaqueConfigurationParameters `json:"opaque,omitempty" protobuf:"bytes,1,opt,name=opaque"`
}

ConfigurationParameters must have one and only one field set.

type Constraint

type Constraint struct {
	// All devices must have this attribute and its value must be the same.
	//
	// For example, if you specified "numa.dra.example.com" (a hypothetical example!),
	// then only devices in the same NUMA node will be chosen.
	//
	// +optional
	// +listType=atomic
	MatchAttribute *string `json:"matchAttribute,omitempty"`
}

Constraint must have one and only one field set.

type Container

type Container struct {
	// Name of the container specified as a DNS_LABEL.
	// Each container in a pod must have a unique name (DNS_LABEL).
	// Cannot be updated.
	Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
	// Container image name.
	// More info: https://kubernetes.io/docs/concepts/containers/images
	// This field is optional to allow higher level config management to default or override
	// container images in workload controllers like Deployments and StatefulSets.
	// +optional
	Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"`
	// Entrypoint array. Not executed within a shell.
	// The container image's ENTRYPOINT is used if this is not provided.
	// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
	// cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
	// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
	// produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
	// of whether the variable exists or not. Cannot be updated.
	// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
	// +optional
	// +listType=atomic
	Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"`

	// Compute Resources required by this container.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
	// +optional
	Resources ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"`
}

A single application container that you want to run within a pod.

type Device

type Device struct {
	// Name is unique identifier among all devices managed by
	// the driver on the node. It must be a DNS label.
	Name string `json:"name" protobuf:"bytes,1,name=name"`

	// Attributes defines the attributes of this device.
	// The name of each attribute must be unique.
	//
	// Must not have more than 32 entries.
	//
	// +listType=atomic
	// +optional
	Attributes []DeviceAttribute `json:"attributes,omitempty" protobuf:"bytes,3,opt,name=attributes"`

	// SharedCapacityConsumed defines the set of shared capacity consumed by
	// this device.
	//
	// Must not have more than 32 entries.
	//
	// +listType=atomic
	// +optional
	SharedCapacityConsumed []SharedCapacity `json:"sharedCapacityConsumed,omitempty"`
}

Device represents one individual hardware instance that can be selected based on its attributes.

type DeviceAttribute

type DeviceAttribute struct {
	// Name is a unique identifier for this attribute, which will be
	// referenced when selecting devices.
	//
	// Attributes are defined either by the owner of the specific driver
	// (usually the vendor) or by some 3rd party (e.g. the Kubernetes
	// project). Because attributes are sometimes compared across devices,
	// a given name is expected to mean the same thing and have the same
	// type on all devices.
	//
	// Attribute names must be either a C-style identifier
	// (e.g. "the_name") or a DNS subdomain followed by a slash ("/")
	// followed by a C-style identifier
	// (e.g. "example.com/the_name"). Attributes whose name does not
	// include the domain prefix are assumed to be part of the driver's
	// domain. Attributes defined by 3rd parties must include the domain
	// prefix.
	//
	// The maximum length for the DNS subdomain is 63 characters (same as
	// for driver names) and the maximum length of the C-style identifier
	// is 32.
	Name string `json:"name" protobuf:"bytes,1,name=name"`

	// QuantityValue is a quantity.
	QuantityValue *resource.Quantity `json:"quantity,omitempty" protobuf:"bytes,2,opt,name=quantity"`
	// BoolValue is a true/false value.
	BoolValue *bool `json:"bool,omitempty" protobuf:"bytes,3,opt,name=bool"`
	// StringValue is a string. Must not be longer than 64 characters.
	StringValue *string `json:"string,omitempty" protobuf:"bytes,4,opt,name=string"`
	// VersionValue is a semantic version according to semver.org spec 2.0.0.
	// Must not be longer than 64 characters.
	VersionValue *string `json:"version,omitempty" protobuf:"bytes,5,opt,name=version"`
}

DeviceAttribute is a combination of an attribute name and its value. Exactly one value must be set.

type DeviceClass

type DeviceClass struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// Config defines configuration parameters that apply to each device which is claimed via this class.
	// Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor
	// configuration applies to exactly one driver.
	//
	// They are passed to the driver, but are not consider while allocating the claim.
	//
	// +optional
	// +listType=atomic
	Config []ConfigurationParameters `json:"config,omitempty"`

	// Requirements must be satisfied by devices. Applies to all devices of
	// a claim when the claim references the class and only to the devices
	// in a request when referenced there.
	//
	// +optional
	// +listType=atomic
	Requirements []Requirement `json:"requirements,omitempty" protobuf:"bytes,4,opt,name=requirements"`
}

DeviceClass is a vendor or admin-provided resource that contains device configuration and requirements. It can be referenced in the device requests of a claim to apply these presets. Cluster scoped.

func (DeviceClass) DeepCopyObject

func (in DeviceClass) DeepCopyObject() runtime.Object

type DeviceConfiguration

type DeviceConfiguration struct {
	// Admins is true if the source of the piece was a class and thus
	// not something that a normal user would have been able to set.
	Admin bool `json:"admin,omnitempty"`

	DriverConfigurationParameters `json:",inline"`
}

DeviceConfiguration is one entry in a list of configuration pieces for a device.

type DriverConfigurationParameters

type DriverConfigurationParameters struct {
	Opaque *runtime.RawExtension `json:"opaque,omitempty" protobuf:"bytes,1,opt,name=opaque"`
}

DriverConfigurationParameters must have one and only one one field set.

In contrast to ConfigurationParameters, the driver name is not included and has to be infered from the context.

type DriverData

type DriverData struct {
	// DriverName specifies the name of the resource driver whose kubelet
	// plugin should be invoked to process the allocation once the claim is
	// needed on a node.
	//
	// Must be a DNS subdomain and should end with a DNS domain owned by the
	// vendor of the driver.
	DriverName string `json:"driverName" protobuf:"bytes,1,name=driverName"`

	// Data contains all information about the allocation that the kubelet
	// plugin will need.
	//
	// +optional
	Data *StructuredDriverData `json:"data,omitempty" protobuf:"bytes,2,opt,name=data"`
}

DriverData holds information for processing by a specific kubelet plugin.

type OpaqueConfigurationParameters

type OpaqueConfigurationParameters struct {
	// DriverName is used to determine which kubelet plugin needs
	// to be passed these configuration parameters.
	//
	// An admission webhook provided by the driver developer could use this
	// to decide whether it needs to validate them.
	//
	// Must be a DNS subdomain and should end with a DNS domain owned by the
	// vendor of the driver.
	DriverName string `json:"driverName" protobuf:"bytes,1,name=driverName"`

	// Parameters can contain arbitrary data. It is the responsibility of
	// the driver developer to handle validation and versioning. Typically this
	// includes self-identification and a version ("kind" + "apiVersion" for
	// Kubernetes types), with conversion between different versions.
	Parameters runtime.RawExtension `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"`
}

OpaqueConfigurationParameters contains configuration parameters for a driver.

type Pod

type Pod struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	Spec PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
}

Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts.

func (Pod) DeepCopyObject

func (in Pod) DeepCopyObject() runtime.Object

type PodResourceClaim

type PodResourceClaim struct {
	// Name uniquely identifies this resource claim inside the pod.
	// This must be a DNS_LABEL.
	Name string `json:"name" protobuf:"bytes,1,opt,name=name"`

	ClaimSource `json:",inline" protobuf:"bytes,2,name=source"`
}

type PodSpec

type PodSpec struct {

	// List of containers belonging to the pod.
	// Containers cannot currently be added or removed.
	// There must be at least one container in a Pod.
	// Cannot be updated.
	// +patchMergeKey=name
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=name
	Containers []Container `json:"containers" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=containers"`

	// ResourceClaims defines which ResourceClaims must be allocated
	// and reserved before the Pod is allowed to start. The resources
	// will be made available to those containers which consume them
	// by name.
	//
	// This is an alpha field and requires enabling the
	// DynamicResourceAllocation feature gate.
	//
	// This field is immutable.
	//
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=name
	// +featureGate=DynamicResourceAllocation
	// +optional
	ResourceClaims []PodResourceClaim `` /* 129-byte string literal not displayed */
}

type Quota

type Quota struct {
	metav1.TypeMeta
	// Standard object metadata.
	metav1.ObjectMeta

	Spec QuotaSpec
}

Quota controls whether a ResourceClaim may get allocated. Quota is namespaced and applies to claims within the same namespace.

type QuotaSpec

type QuotaSpec struct {
	// AllowManagementAccess controls whether claims with ManagementAccess
	// may be allocated. If multiple quota objects exist and at least one
	// has a true value, access will be allowed. The default to deny such access.
	//
	// +optional
	AllowManagementAccess bool `json:"allowManagementAccess,omitempty"`
}

type Request

type Request struct {
	// The name can be used to reference this request in a pod.spec.containers[].resources.claims
	// entry.
	//
	// Must be a DNS label.
	Name string `json:"name" protobuf:"bytes,1,name=name"`

	*ResourceRequestDetail `json:",inline,omitempty"`
}

Request is a request for one of many resources required for a claim. This is typically a request for a single resource like a device, but can also ask for one of several different alternatives.

type RequestAllocationResult

type RequestAllocationResult struct {
	// Config contains all the configuration pieces that apply to the request
	// and that were meant for the driver which handles these resources.
	// They get collected during the allocation and stored here
	// to ensure that they remain available while the claim is allocated.
	//
	// Entries are list in the same order as in class.config and claim.config,
	// with class.config entries first.
	//
	// +optional
	Config []DeviceConfiguration `json:"config,omitempty"`

	// RequestName identifies the request in the claim which caused this
	// device to be allocated.
	RequestName string `json:"requestName"`

	// DeviceName references one device instance via its name in the resource
	// pool. Driver name and node name have to be determined from the
	// context.
	DeviceName string `json:"deviceName"`
}

RequestAllocationResult contains configuration and the allocation result for one request.

type Requirement

type Requirement struct {
	// This CEL expression which must evaluate to true if a
	// device is suitable. This covers qualitative aspects of
	// device selection.
	//
	// The language is as defined in
	// https://kubernetes.io/docs/reference/using-api/cel/
	// with several additions that are specific to device selectors.
	//
	// For each attribute type there is a
	// `device.<type>Attributes` map that resolves to the corresponding
	// value of the instance under evaluation. The type of those map
	// entries are known at compile time, which makes it easier to
	// detect errors like string to int comparisons.
	//
	// In cases where such type safety is not needed or not desired,
	// `device.attributes` can be used instead. The type of the entries
	// then only gets checked at runtime.
	//
	// Unknown keys are not an error. Instead, `device.<type>Attributes`
	// returns a default value for each type:
	// - empty string
	// - false for a boolean
	// - zero quantity
	// - 0.0.0 for a version
	//
	// `device.attributes` returns nil.
	//
	// The `device.driverName` string variable can be used to check for a specific
	// driver explicitly in a filter that is meant to work for devices from
	// different vendors. It is provided by Kubernetes and matches the
	// `driverName` from the ResourcePool which provides the device.
	//
	// The CEL expression is applied to *all* available devices from any driver.
	// Because of the defaults, it is safe to reference and use attribute values
	// without checking first whether they are set. For this to work without
	// ambiguity, attribute names have to be fully-qualified.
	//
	// Some examples:
	//    device.quantityAttributes["memory.dra.example.com"].isGreaterThan(quantity("1Gi")) # >= 1Gi
	//    "memory.dra.example.com" in device.attributes # attribute is set
	//
	// +optional
	DeviceSelector *string `json:"deviceSelector,omitempty" protobuf:"bytes,1,opt,name=deviceSelector"`
}

Requirement must have one and only one field set.

type ResourceClaim

type ResourceClaim struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// Spec defines what to allocated and how to configure it.
	Spec ResourceClaimSpec `json:"spec"`

	// Status describes whether the claim is ready for use.
	// +optional
	Status ResourceClaimStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}

ResourceClaim describes which resources (typically one or more devices) are needed by a claim consumer. Its status tracks whether the claim has been allocated and what the resulting attributes are.

This is an alpha type and requires enabling the DynamicResourceAllocation feature gate.

func (ResourceClaim) DeepCopyObject

func (in ResourceClaim) DeepCopyObject() runtime.Object

type ResourceClaimConsumerReference

type ResourceClaimConsumerReference struct {
	// APIGroup is the group for the resource being referenced. It is
	// empty for the core API. This matches the group in the APIVersion
	// that is used when creating the resources.
	// +optional
	APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=apiGroup"`
	// Resource is the type of resource being referenced, for example "pods".
	Resource string `json:"resource" protobuf:"bytes,3,name=resource"`
	// Name is the name of resource being referenced.
	Name string `json:"name" protobuf:"bytes,4,name=name"`
	// UID identifies exactly one incarnation of the resource.
	UID types.UID `json:"uid" protobuf:"bytes,5,name=uid"`
}

ResourceClaimConsumerReference contains enough information to let you locate the consumer of a ResourceClaim. The user must be a resource in the same namespace as the ResourceClaim.

type ResourceClaimEntry

type ResourceClaimEntry struct {
	// Name must match the name of one entry in pod.spec.resourceClaims of
	// the Pod where this field is used. It makes that resource available
	// inside a container.
	Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
	// A name set in claim.spec.requests[].name.
	// +optional
	RequestName string `json:"requestName" protobuf:"bytes,2,opt,name=requestName"`
}

ResourceClaimEntry references one entry in PodSpec.ResourceClaims. It also, optional references specific devices inside a claim. If the named request is satisfied by allocating multiple devices, then all of those are matched.

type ResourceClaimSpec

type ResourceClaimSpec struct {
	// This field holds configuration for multiple potential drivers which
	// could satisfy requests in this claim. The configuration applies to
	// the entire claim. It is ignored while allocating the claim.
	//
	// +optional
	// +listType=atomic
	Config []ConfigurationParameters `json:"config,omitempty" protobuf:"bytes,4,opt,name=config"`

	// These constraints must be satisfied by the set of devices that get
	// allocated for the claim.
	Constraints []Constraint `json:"constraints"`

	// Requests are individual requests for separate resources for the claim.
	// An empty list is valid and means that the claim can always be allocated
	// without needing anything. A class can be referenced to use the default
	// requests from that class.
	//
	// +listType=atomic
	Requests []Request `json:"requests,omitempty" protobuf:"bytes,5,name=requests"`

	// Shareable indicates whether the allocated claim is meant to be shareable
	// by multiple consumers at the same time.
	// +optional
	Shareable bool `json:"shareable,omitempty" protobuf:"bytes,3,opt,name=shareable"`
}

type ResourceClaimSpecReference

type ResourceClaimSpecReference struct {
	// APIGroup is the group for the resource being referenced. It is
	// empty for the core API. This matches the group in the APIVersion
	// that is used when creating the resources.
	// +optional
	APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=apiGroup"`
	// Kind is the type of resource being referenced. This is the same
	// value as in the parameter object's metadata, for example "ConfigMap".
	Kind string `json:"kind" protobuf:"bytes,2,name=kind"`
	// Name is the name of resource being referenced.
	Name string `json:"name" protobuf:"bytes,3,name=name"`
}

ResourceClaimSpecReference contains enough information to let you locate the specification for a ResourceClaim. The object must be in the same namespace as the ResourceClaim.

type ResourceClaimStatus

type ResourceClaimStatus struct {
	// Allocation is set once the claim has been allocated successfully.
	// +optional
	Allocation *AllocationResult `json:"allocation,omitempty" protobuf:"bytes,2,opt,name=allocation"`

	// ReservedFor indicates which entities are currently allowed to use
	// the claim. A Pod which references a ResourceClaim which is not
	// reserved for that Pod will not be started.
	//
	// There can be at most 32 such reservations. This may get increased in
	// the future, but not reduced.
	//
	// +listType=map
	// +listMapKey=uid
	// +patchStrategy=merge
	// +patchMergeKey=uid
	// +optional
	ReservedFor []ResourceClaimConsumerReference `json:"reservedFor,omitempty" protobuf:"bytes,3,opt,name=reservedFor" patchStrategy:"merge" patchMergeKey:"uid"`
}

ResourceClaimStatus tracks whether the resource has been allocated and what the result of that was.

type ResourceClaimTemplate

type ResourceClaimTemplate struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// Describes the ResourceClaim that is to be generated.
	//
	// This field is immutable. A ResourceClaim will get created by the
	// control plane for a Pod when needed and then not get updated
	// anymore.
	Spec ResourceClaimTemplateSpec `json:"spec" protobuf:"bytes,2,name=spec"`
}

ResourceClaimTemplate is used to produce ResourceClaim objects.

func (ResourceClaimTemplate) DeepCopyObject

func (in ResourceClaimTemplate) DeepCopyObject() runtime.Object

type ResourceClaimTemplateSpec

type ResourceClaimTemplateSpec struct {
	// ObjectMeta may contain labels and annotations that will be copied into the PVC
	// when creating it. No other fields are allowed and will be rejected during
	// validation.
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// Spec for the ResourceClaim. The entire content is copied unchanged
	// into the ResourceClaim that gets created from this template. The
	// same fields as in a ResourceClaim are also valid here.
	Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"`
}

ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.

type ResourceList

type ResourceList map[ResourceName]resource.Quantity

ResourceList is a set of (resource name, quantity) pairs.

type ResourceName

type ResourceName string

ResourceName is the name identifying various resources in a ResourceList.

type ResourcePool

type ResourcePool struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	Spec ResourcePoolSpec `json:"spec"`
}

ResourcePool represents a collection of devices managed by a given driver. How devices are divided into pools is driver-specific, but typically the expectation would a be a pool per identical collection of devices, per node. It is fine to have more than one pool for a given node, for the same driver.

Where a device gets published may change over time. The unique identifier for a device is the tuple `<driver name>/<node name>/<device name>`. Each of these names is a DNS label or domain, so it is okay to concatenate them like this in a string with a slash as separator.

Consumers should be prepared to handle situations where the same device is listed in different pools, for example because the producer already added it to a new pool before removing it from an old one. Should this occur, then there is still only one such device instance. If the two device definitions disagree in any way, the one found in the newest ResourcePool, as determined by creationTimestamp, is preferred.

func (ResourcePool) DeepCopyObject

func (in ResourcePool) DeepCopyObject() runtime.Object

type ResourcePoolSpec

type ResourcePoolSpec struct {
	// NodeName identifies the node which provides the devices. All devices
	// are local to that node.
	//
	// This is currently required, but this might get relaxed in the future.
	NodeName string `json:"nodeName"`

	// DriverName identifies the DRA driver providing the capacity information.
	// A field selector can be used to list only ResourcePool
	// objects with a certain driver name.
	//
	// Must be a DNS subdomain and should end with a DNS domain owned by the
	// vendor of the driver.
	DriverName string `json:"driverName" protobuf:"bytes,3,name=driverName"`

	// SharedCapacity defines the set of shared capacity consumable by
	// devices in this ResourceSlice.
	//
	// Must not have more than 128 entries.
	//
	// +listType=atomic
	// +optional
	SharedCapacity []SharedCapacity `json:"sharedCapacity,omitempty"`

	// Devices lists all available devices in this pool.
	//
	// Must not have more than 128 entries.
	Devices []Device `json:"devices,omitempty"`
}

type ResourceRequestDetail

type ResourceRequestDetail struct {
	// When referencing a DeviceClass, a request inherits additional
	// configuration and requirements.
	//
	// +optional
	DeviceClassName *string `json:"deviceClassName,omitempty"`

	// Config defines configuration parameters that apply to the requested resource(s).
	// They are ignored while allocating the claim.
	//
	// +optional
	// +listType=atomic
	Config []ConfigurationParameters `json:"config,omitempty" protobuf:"bytes,1,opt,name=config"`

	// AdminAccess indicates that this is a claim for administrative access
	// to the device(s). Claims with AdminAccess are expected to be used for
	// monitoring or other management services for a device.  They ignore
	// all ordinary claims to the device with respect to access modes and
	// any resource allocations. Ability to request this kind of access is
	// controlled via ResourceQuota in the resource.k8s.io API.
	//
	// Can be combined with a range to ask for access to all devices
	// on a node which match the requrirements.
	//
	// Default is false.
	//
	// +optional
	AdminAccess *bool `json:"adminAccess,omitempty"`

	// Requirements describe additional contraints that all must be met by a device
	// to satisfy the request.
	//
	// +optional
	// +listType=atomic
	Requirements []Requirement `json:"requirements,omitempty" protobuf:"bytes,4,opt,name=requirements"`
}

type ResourceRequirements

type ResourceRequirements struct {
	// Limits describes the maximum amount of compute resources allowed.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
	// +optional
	Limits ResourceList `json:"limits,omitempty" protobuf:"bytes,1,rep,name=limits,casttype=ResourceList,castkey=ResourceName"`

	// Requests describes the minimum amount of compute resources required.
	// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
	// otherwise to an implementation-defined value. Requests cannot exceed Limits.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
	// +optional
	Requests ResourceList `json:"requests,omitempty" protobuf:"bytes,2,rep,name=requests,casttype=ResourceList,castkey=ResourceName"`

	// Claims lists the names of resources, defined in spec.resourceClaims,
	// that are used by this container.
	//
	// This is an alpha field and requires enabling the
	// DynamicResourceAllocation feature gate.
	//
	// This field is immutable. It can only be set for containers.
	//
	// +listType=map
	// +listMapKey=name
	// +featureGate=DynamicResourceAllocation
	// +optional
	Claims []ResourceClaimEntry `json:"claims,omitempty" protobuf:"bytes,3,opt,name=claims"`
}

ResourceRequirements describes the compute resource requirements.

type SharedCapacity

type SharedCapacity struct {
	// Name is a unique identifier among all shared capacities managed by the
	// driver in the pool.
	//
	// It is referenced both when defining the total amount of shared capacity
	// that is available, as well as by individual devices when declaring
	// how much of this shared capacity they consume.
	//
	// SharedCapacity names must be a C-style identifier (e.g. "the_name") with
	// a maximum length of 32.
	//
	// By limiting these names to a C-style identifier, the same validation can
	// be used for both these names and the identifier portion of a
	// DeviceAttribute name.
	//
	// +required
	Name string `json:"name"`

	// Capacity is the total capacity of the named resource.
	// This can either represent the total *available* capacity, or the total
	// capacity *consumed*, depending on the context where it is referenced.
	//
	// +required
	Capacity resource.Quantity `json:"capacity"`
}

type StructuredDriverData

type StructuredDriverData struct {
	// Config contains all the configuration pieces that apply to the entire claim
	// and that were meant for the driver which handles these resources.
	// They get collected during the allocation and stored here
	// to ensure that they remain available while the claim is allocated.
	//
	// Entries are listed in the same order as in claim.config.
	//
	// +optional
	Config []DriverConfigurationParameters `json:"config,omitempty"`

	// Results lists all allocated driver resources.
	//
	// +listType=atomic
	Results []RequestAllocationResult `json:"results" protobuf:"bytes,4,name=results"`
}

StructuredDriverData is the in-tree representation of the allocation result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL