dynamicresources

package
v1.32.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 31 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Name is the name of the plugin used in Registry and configurations.
	Name = names.DynamicResources
)

Variables

This section is empty.

Functions

func New

New initializes a new plugin and returns it.

Types

type DefaultDRAManager added in v1.32.0

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

DefaultDRAManager is the default implementation of SharedDRAManager. It obtains the DRA objects from API informers, and uses an AssumeCache and a map of in-flight allocations in order to avoid race conditions when modifying ResourceClaims.

func NewDRAManager added in v1.32.0

func NewDRAManager(ctx context.Context, claimsCache *assumecache.AssumeCache, informerFactory informers.SharedInformerFactory) *DefaultDRAManager

func (*DefaultDRAManager) DeviceClasses added in v1.32.0

func (s *DefaultDRAManager) DeviceClasses() framework.DeviceClassLister

func (*DefaultDRAManager) ResourceClaims added in v1.32.0

func (s *DefaultDRAManager) ResourceClaims() framework.ResourceClaimTracker

func (*DefaultDRAManager) ResourceSlices added in v1.32.0

func (s *DefaultDRAManager) ResourceSlices() framework.ResourceSliceLister

type DynamicResources added in v1.32.0

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

DynamicResources is a plugin that ensures that ResourceClaims are allocated.

func (*DynamicResources) EventsToRegister added in v1.32.0

func (pl *DynamicResources) EventsToRegister(_ context.Context) ([]framework.ClusterEventWithHint, error)

EventsToRegister returns the possible events that may make a Pod failed by this plugin schedulable.

func (*DynamicResources) Filter added in v1.32.0

func (pl *DynamicResources) Filter(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status

Filter invoked at the filter extension point. It evaluates if a pod can fit due to the resources it requests, for both allocated and unallocated claims.

For claims that are bound, then it checks that the node affinity is satisfied by the given node.

For claims that are unbound, it checks whether the claim might get allocated for the node.

func (*DynamicResources) Name added in v1.32.0

func (pl *DynamicResources) Name() string

Name returns name of the plugin. It is used in logs, etc.

func (*DynamicResources) PostFilter added in v1.32.0

PostFilter checks whether there are allocated claims that could get deallocated to help get the Pod schedulable. If yes, it picks one and requests its deallocation. This only gets called when filtering found no suitable node.

func (*DynamicResources) PreBind added in v1.32.0

func (pl *DynamicResources) PreBind(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status

PreBind gets called in a separate goroutine after it has been determined that the pod should get bound to this node. Because Reserve did not actually reserve claims, we need to do it now. For claims with the builtin controller, we also handle the allocation.

If anything fails, we return an error and the pod will have to go into the backoff queue. The scheduler will call Unreserve as part of the error handling.

func (*DynamicResources) PreEnqueue added in v1.32.0

func (pl *DynamicResources) PreEnqueue(ctx context.Context, pod *v1.Pod) (status *framework.Status)

PreEnqueue checks if there are known reasons why a pod currently cannot be scheduled. When this fails, one of the registered events can trigger another attempt.

func (*DynamicResources) PreFilter added in v1.32.0

PreFilter invoked at the prefilter extension point to check if pod has all immediate claims bound. UnschedulableAndUnresolvable is returned if the pod cannot be scheduled at the moment on any node.

func (*DynamicResources) PreFilterExtensions added in v1.32.0

func (pl *DynamicResources) PreFilterExtensions() framework.PreFilterExtensions

PreFilterExtensions returns prefilter extensions, pod add and remove.

func (*DynamicResources) Reserve added in v1.32.0

func (pl *DynamicResources) Reserve(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeName string) (status *framework.Status)

Reserve reserves claims for the pod.

func (*DynamicResources) Unreserve added in v1.32.0

func (pl *DynamicResources) Unreserve(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeName string)

Unreserve clears the ReservedFor field for all claims. It's idempotent, and does nothing if no state found for the given pod.

Jump to

Keyboard shortcuts

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