resource

package
v1.27.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Package resource contains the latest (or "internal") version of the Kubernetes resource API objects.

Index

Constants

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

GroupName is the group name use in this package

View Source
const PodSchedulingNodeListMaxSize = 128

PodSchedulingNodeListMaxSize defines the maximum number of entries in the node lists that are stored in PodScheduling objects. This limit is part of the API.

View Source
const ResourceClaimReservedForMaxSize = 32

ReservedForMaxSize is the maximum number of entries in claim.status.reservedFor.

View Source
const ResourceHandleMaxSize = 16 * 1024

ResourceHandleMaxSize is the maximum size of allocation.resourceHandle.

Variables

View Source
var (
	// SchemeBuilder object to register various known types
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// AddToScheme represents a func that can be used to apply all the registered
	// funcs in a scheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type AllocationMode

type AllocationMode string

AllocationMode describes whether a ResourceClaim gets allocated immediately when it gets created (AllocationModeImmediate) or whether allocation is delayed until it is needed for a Pod (AllocationModeWaitForFirstConsumer). Other modes might get added in the future.

const (
	// When a ResourceClaim has AllocationModeWaitForFirstConsumer, allocation is
	// delayed until a Pod gets scheduled that needs the ResourceClaim. The
	// scheduler will consider all resource requirements of that Pod and
	// trigger allocation for a node that fits the Pod.
	AllocationModeWaitForFirstConsumer AllocationMode = "WaitForFirstConsumer"

	// When a ResourceClaim has AllocationModeImmediate, allocation starts
	// as soon as the ResourceClaim gets created. This is done without
	// considering the needs of Pods that will use the ResourceClaim
	// because those Pods are not known yet.
	AllocationModeImmediate AllocationMode = "Immediate"
)

type AllocationResult

type AllocationResult struct {
	// ResourceHandle contains arbitrary data returned by the driver after a
	// successful allocation. This is opaque for
	// Kubernetes. Driver documentation may explain to users how to
	// interpret this data if needed.
	//
	// The maximum size of this field is 16KiB. This may get
	// increased in the future, but not reduced.
	// +optional
	ResourceHandle string

	// This field will get set by the resource driver after it has
	// allocated the resource driver to inform the scheduler where it can
	// schedule Pods using the ResourceClaim.
	//
	// Setting this field is optional. If null, the resource is available
	// everywhere.
	// +optional
	AvailableOnNodes *core.NodeSelector

	// Shareable determines whether the resource supports more
	// than one consumer at a time.
	// +optional
	Shareable bool
}

AllocationResult contains attributed of an allocated resource.

func (*AllocationResult) DeepCopy

func (in *AllocationResult) DeepCopy() *AllocationResult

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllocationResult.

func (*AllocationResult) DeepCopyInto

func (in *AllocationResult) DeepCopyInto(out *AllocationResult)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodScheduling

type PodScheduling struct {
	metav1.TypeMeta
	// Standard object metadata
	// +optional
	metav1.ObjectMeta

	// Spec describes where resources for the Pod are needed.
	Spec PodSchedulingSpec

	// Status describes where resources for the Pod can be allocated.
	Status PodSchedulingStatus
}

PodScheduling objects hold information that is needed to schedule a Pod with ResourceClaims that use "WaitForFirstConsumer" allocation mode.

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

func (*PodScheduling) DeepCopy

func (in *PodScheduling) DeepCopy() *PodScheduling

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodScheduling.

func (*PodScheduling) DeepCopyInto

func (in *PodScheduling) DeepCopyInto(out *PodScheduling)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PodScheduling) DeepCopyObject

func (in *PodScheduling) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PodSchedulingList

type PodSchedulingList struct {
	metav1.TypeMeta
	// Standard list metadata
	// +optional
	metav1.ListMeta

	// Items is the list of PodScheduling objects.
	Items []PodScheduling
}

PodSchedulingList is a collection of Pod scheduling objects.

func (*PodSchedulingList) DeepCopy

func (in *PodSchedulingList) DeepCopy() *PodSchedulingList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSchedulingList.

func (*PodSchedulingList) DeepCopyInto

func (in *PodSchedulingList) DeepCopyInto(out *PodSchedulingList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PodSchedulingList) DeepCopyObject

func (in *PodSchedulingList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PodSchedulingSpec

type PodSchedulingSpec struct {
	// SelectedNode is the node for which allocation of ResourceClaims that
	// are referenced by the Pod and that use "WaitForFirstConsumer"
	// allocation is to be attempted.
	SelectedNode string

	// PotentialNodes lists nodes where the Pod might be able to run.
	//
	// The size of this field is limited to 128. This is large enough for
	// many clusters. Larger clusters may need more attempts to find a node
	// that suits all pending resources. This may get increased in the
	// future, but not reduced.
	// +optional
	PotentialNodes []string
}

PodSchedulingSpec describes where resources for the Pod are needed.

func (*PodSchedulingSpec) DeepCopy

func (in *PodSchedulingSpec) DeepCopy() *PodSchedulingSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSchedulingSpec.

func (*PodSchedulingSpec) DeepCopyInto

func (in *PodSchedulingSpec) DeepCopyInto(out *PodSchedulingSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodSchedulingStatus

type PodSchedulingStatus struct {
	// ResourceClaims describes resource availability for each
	// pod.spec.resourceClaim entry where the corresponding ResourceClaim
	// uses "WaitForFirstConsumer" allocation mode.
	// +optional
	ResourceClaims []ResourceClaimSchedulingStatus
}

PodSchedulingStatus describes where resources for the Pod can be allocated.

func (*PodSchedulingStatus) DeepCopy

func (in *PodSchedulingStatus) DeepCopy() *PodSchedulingStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSchedulingStatus.

func (*PodSchedulingStatus) DeepCopyInto

func (in *PodSchedulingStatus) DeepCopyInto(out *PodSchedulingStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceClaim

type ResourceClaim struct {
	metav1.TypeMeta
	// Standard object metadata
	// +optional
	metav1.ObjectMeta

	// Spec describes the desired attributes of a resource that then needs
	// to be allocated. It can only be set once when creating the
	// ResourceClaim.
	Spec ResourceClaimSpec

	// Status describes whether the resource is available and with which
	// attributes.
	// +optional
	Status ResourceClaimStatus
}

ResourceClaim describes which resources are needed by a resource consumer. Its status tracks whether the resource has been allocated and what the resulting attributes are.

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

func (*ResourceClaim) DeepCopy

func (in *ResourceClaim) DeepCopy() *ResourceClaim

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaim.

func (*ResourceClaim) DeepCopyInto

func (in *ResourceClaim) DeepCopyInto(out *ResourceClaim)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceClaim) DeepCopyObject

func (in *ResourceClaim) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new 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
	// Resource is the type of resource being referenced, for example "pods".
	Resource string
	// Name is the name of resource being referenced.
	Name string
	// UID identifies exactly one incarnation of the resource.
	UID types.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.

func (*ResourceClaimConsumerReference) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimConsumerReference.

func (*ResourceClaimConsumerReference) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceClaimList

type ResourceClaimList struct {
	metav1.TypeMeta
	// Standard list metadata
	// +optional
	metav1.ListMeta

	// Items is the list of resource claims.
	Items []ResourceClaim
}

ResourceClaimList is a collection of claims.

func (*ResourceClaimList) DeepCopy

func (in *ResourceClaimList) DeepCopy() *ResourceClaimList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimList.

func (*ResourceClaimList) DeepCopyInto

func (in *ResourceClaimList) DeepCopyInto(out *ResourceClaimList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceClaimList) DeepCopyObject

func (in *ResourceClaimList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ResourceClaimParametersReference

type ResourceClaimParametersReference 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
	// 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
	// Name is the name of resource being referenced.
	Name string
}

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

func (*ResourceClaimParametersReference) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimParametersReference.

func (*ResourceClaimParametersReference) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceClaimSchedulingStatus

type ResourceClaimSchedulingStatus struct {
	// Name matches the pod.spec.resourceClaims[*].Name field.
	Name string

	// UnsuitableNodes lists nodes that the ResourceClaim cannot be
	// allocated for.
	//
	// The size of this field is limited to 128, the same as for
	// PodSchedulingSpec.PotentialNodes. This may get increased in the
	// future, but not reduced.
	// +optional
	UnsuitableNodes []string
}

ResourceClaimSchedulingStatus contains information about one particular ResourceClaim with "WaitForFirstConsumer" allocation mode.

func (*ResourceClaimSchedulingStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimSchedulingStatus.

func (*ResourceClaimSchedulingStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceClaimSpec

type ResourceClaimSpec struct {
	// ResourceClassName references the driver and additional parameters
	// via the name of a ResourceClass that was created as part of the
	// driver deployment.
	ResourceClassName string

	// ParametersRef references a separate object with arbitrary parameters
	// that will be used by the driver when allocating a resource for the
	// claim.
	//
	// The object must be in the same namespace as the ResourceClaim.
	// +optional
	ParametersRef *ResourceClaimParametersReference

	// Allocation can start immediately or when a Pod wants to use the
	// resource. "WaitForFirstConsumer" is the default.
	// +optional
	AllocationMode AllocationMode
}

ResourceClaimSpec defines how a resource is to be allocated.

func (*ResourceClaimSpec) DeepCopy

func (in *ResourceClaimSpec) DeepCopy() *ResourceClaimSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimSpec.

func (*ResourceClaimSpec) DeepCopyInto

func (in *ResourceClaimSpec) DeepCopyInto(out *ResourceClaimSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceClaimStatus

type ResourceClaimStatus struct {
	// DriverName is a copy of the driver name from the ResourceClass at
	// the time when allocation started.
	// +optional
	DriverName string

	// Allocation is set by the resource driver once a resource has been
	// allocated successfully. If this is not specified, the resource is
	// not yet allocated.
	// +optional
	Allocation *AllocationResult

	// 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.
	// +optional
	ReservedFor []ResourceClaimConsumerReference

	// DeallocationRequested indicates that a ResourceClaim is to be
	// deallocated.
	//
	// The driver then must deallocate this claim and reset the field
	// together with clearing the Allocation field.
	//
	// While DeallocationRequested is set, no new consumers may be added to
	// ReservedFor.
	// +optional
	DeallocationRequested bool
}

ResourceClaimStatus tracks whether the resource has been allocated and what the resulting attributes are.

func (*ResourceClaimStatus) DeepCopy

func (in *ResourceClaimStatus) DeepCopy() *ResourceClaimStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimStatus.

func (*ResourceClaimStatus) DeepCopyInto

func (in *ResourceClaimStatus) DeepCopyInto(out *ResourceClaimStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceClaimTemplate

type ResourceClaimTemplate struct {
	metav1.TypeMeta
	// Standard object metadata
	// +optional
	metav1.ObjectMeta

	// 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
}

ResourceClaimTemplate is used to produce ResourceClaim objects.

func (*ResourceClaimTemplate) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimTemplate.

func (*ResourceClaimTemplate) DeepCopyInto

func (in *ResourceClaimTemplate) DeepCopyInto(out *ResourceClaimTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceClaimTemplate) DeepCopyObject

func (in *ResourceClaimTemplate) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ResourceClaimTemplateList

type ResourceClaimTemplateList struct {
	metav1.TypeMeta
	// Standard list metadata
	// +optional
	metav1.ListMeta

	// Items is the list of resource claim templates.
	Items []ResourceClaimTemplate
}

ResourceClaimTemplateList is a collection of claim templates.

func (*ResourceClaimTemplateList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimTemplateList.

func (*ResourceClaimTemplateList) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceClaimTemplateList) DeepCopyObject

func (in *ResourceClaimTemplateList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new 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

	// 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
}

ResourceClaimTemplateSpec contains the metadata and fields for a ResourceClaim.

func (*ResourceClaimTemplateSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClaimTemplateSpec.

func (*ResourceClaimTemplateSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceClass

type ResourceClass struct {
	metav1.TypeMeta
	// Standard object metadata
	// +optional
	metav1.ObjectMeta

	// DriverName defines the name of the dynamic resource driver that is
	// used for allocation of a ResourceClaim that uses this class.
	//
	// Resource drivers have a unique name in forward domain order
	// (acme.example.com).
	DriverName string

	// ParametersRef references an arbitrary separate object that may hold
	// parameters that will be used by the driver when allocating a
	// resource that uses this class. A dynamic resource driver can
	// distinguish between parameters stored here and and those stored in
	// ResourceClaimSpec.
	// +optional
	ParametersRef *ResourceClassParametersReference

	// Only nodes matching the selector will be considered by the scheduler
	// when trying to find a Node that fits a Pod when that Pod uses
	// a ResourceClaim that has not been allocated yet.
	//
	// Setting this field is optional. If null, all nodes are candidates.
	// +optional
	SuitableNodes *core.NodeSelector
}

ResourceClass is used by administrators to influence how resources are allocated.

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

func (*ResourceClass) DeepCopy

func (in *ResourceClass) DeepCopy() *ResourceClass

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClass.

func (*ResourceClass) DeepCopyInto

func (in *ResourceClass) DeepCopyInto(out *ResourceClass)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceClass) DeepCopyObject

func (in *ResourceClass) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ResourceClassList

type ResourceClassList struct {
	metav1.TypeMeta
	// Standard list metadata
	// +optional
	metav1.ListMeta

	// Items is the list of resource classes.
	Items []ResourceClass
}

ResourceClassList is a collection of classes.

func (*ResourceClassList) DeepCopy

func (in *ResourceClassList) DeepCopy() *ResourceClassList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassList.

func (*ResourceClassList) DeepCopyInto

func (in *ResourceClassList) DeepCopyInto(out *ResourceClassList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceClassList) DeepCopyObject

func (in *ResourceClassList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ResourceClassParametersReference

type ResourceClassParametersReference 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
	// Kind is the type of resource being referenced. This is the same
	// value as in the parameter object's metadata.
	Kind string
	// Name is the name of resource being referenced.
	Name string
	// Namespace that contains the referenced resource. Must be empty
	// for cluster-scoped resources and non-empty for namespaced
	// resources.
	// +optional
	Namespace string
}

ResourceClassParametersReference contains enough information to let you locate the parameters for a ResourceClass.

func (*ResourceClassParametersReference) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceClassParametersReference.

func (*ResourceClassParametersReference) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Directories

Path Synopsis
Package install installs the resource API, making it available as an option to all of the API encoding/decoding machinery.
Package install installs the resource API, making it available as an option to all of the API encoding/decoding machinery.
Package v1alpha1 is the v1alpha1 version of the resource API.
Package v1alpha1 is the v1alpha1 version of the resource API.

Jump to

Keyboard shortcuts

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