dynamic-resource-allocationk8s.io/dynamic-resource-allocation/structured/internal/experimental Index | Files

package experimental

import "k8s.io/dynamic-resource-allocation/structured/internal/experimental"

Index

Variables

var SupportedFeatures = internal.Features{
	AdminAccess:          true,
	PrioritizedList:      true,
	PartitionableDevices: true,
	DeviceTaints:         true,
	DeviceBinding:        true,
	DeviceStatus:         true,
	ConsumableCapacity:   true,
}

SupportedFeatures includes all additional features, making this the variant that is used when any of those are enabled.

Functions

func CmpRequestOverCapacity

func CmpRequestOverCapacity(currentConsumedCapacity ConsumedCapacity, deviceRequestCapacity *resourceapi.CapacityRequirements,
	allowMultipleAllocations *bool, capacity map[draapi.QualifiedName]draapi.DeviceCapacity, allocatingCapacity ConsumedCapacity) (bool, error)

CmpRequestOverCapacity checks whether the new capacity request can be added within the given capacity, and checks whether the requested value is against the capacity requestPolicy.

func GenerateNewShareID

func GenerateNewShareID() *types.UID

func GetConsumedCapacityFromRequest

func GetConsumedCapacityFromRequest(requestedCapacity *resourceapi.CapacityRequirements,
	consumableCapacity map[resourceapi.QualifiedName]resourceapi.DeviceCapacity) map[resourceapi.QualifiedName]resource.Quantity

GetConsumedCapacityFromRequest returns valid consumed capacity, according to claim request and defined capacity.

Types

type AllocatedState

type AllocatedState = internal.AllocatedState

type Allocator

type Allocator struct {
	// contains filtered or unexported fields
}

func NewAllocator

func NewAllocator(ctx context.Context,
	features Features,
	allocatedState AllocatedState,
	classLister DeviceClassLister,
	slices []*resourceapi.ResourceSlice,
	celCache *cel.Cache,
) (*Allocator, error)

NewAllocator returns an allocator for a certain set of claims or an error if some problem was detected which makes it impossible to allocate claims.

The returned Allocator can be used multiple times and is thread-safe.

func (*Allocator) Allocate

func (a *Allocator) Allocate(ctx context.Context, node *v1.Node, claims []*resourceapi.ResourceClaim) (finalResult []resourceapi.AllocationResult, finalErr error)

func (*Allocator) GetStats

func (a *Allocator) GetStats() Stats

type ConsumedCapacity

type ConsumedCapacity = internal.ConsumedCapacity

func NewConsumedCapacity

func NewConsumedCapacity() ConsumedCapacity

type ConsumedCapacityCollection

type ConsumedCapacityCollection = internal.ConsumedCapacityCollection

func NewConsumedCapacityCollection

func NewConsumedCapacityCollection() ConsumedCapacityCollection

type DeviceClassLister

type DeviceClassLister = internal.DeviceClassLister

type DeviceConsumedCapacity

type DeviceConsumedCapacity = internal.DeviceConsumedCapacity

func NewDeviceConsumedCapacity

func NewDeviceConsumedCapacity(deviceID DeviceID,
	consumedCapacity map[resourceapi.QualifiedName]resource.Quantity) DeviceConsumedCapacity

type DeviceID

type DeviceID = internal.DeviceID

func MakeDeviceID

func MakeDeviceID(driver, pool, device string) DeviceID

type Features

type Features = internal.Features

type Pool

type Pool struct {
	PoolID
	IsIncomplete  bool
	IsInvalid     bool
	InvalidReason string
	Slices        []*draapi.ResourceSlice
}

func GatherPools

func GatherPools(ctx context.Context, slices []*resourceapi.ResourceSlice, node *v1.Node, features Features) ([]*Pool, error)

GatherPools collects information about all resource pools which provide devices that are accessible from the given node.

Out-dated slices are silently ignored. Pools may be incomplete (not all required slices available) or invalid (for example, device names not unique). Both is recorded in the result.

type PoolID

type PoolID struct {
	Driver, Pool draapi.UniqueString
}

func (PoolID) String

func (p PoolID) String() string

type SharedDeviceID

type SharedDeviceID = internal.SharedDeviceID

types_experimental

type Stats

type Stats = internal.Stats

Source Files

allocator_experimental.go constraint.go consumable_capacity.go pools_experimental.go

Version
v0.35.0-alpha.0
Published
Aug 7, 2025
Platform
js/wasm
Imports
20 packages
Last checked
11 minutes ago

Tools for package owners.