Documentation ¶
Index ¶
- Constants
- func New(ctx context.Context, plArgs runtime.Object, fh framework.Handle, ...) (framework.Plugin, error)
- type DefaultDRAManager
- type DynamicResources
- func (pl *DynamicResources) EventsToRegister(_ context.Context) ([]framework.ClusterEventWithHint, error)
- func (pl *DynamicResources) Filter(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (pl *DynamicResources) Name() string
- func (pl *DynamicResources) PostFilter(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, ...) (*framework.PostFilterResult, *framework.Status)
- func (pl *DynamicResources) PreBind(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status
- func (pl *DynamicResources) PreEnqueue(ctx context.Context, pod *v1.Pod) (status *framework.Status)
- func (pl *DynamicResources) PreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) (*framework.PreFilterResult, *framework.Status)
- func (pl *DynamicResources) PreFilterExtensions() framework.PreFilterExtensions
- func (pl *DynamicResources) Reserve(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeName string) (status *framework.Status)
- func (pl *DynamicResources) Unreserve(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeName string)
Constants ¶
const ( // Name is the name of the plugin used in Registry and configurations. Name = names.DynamicResources )
Variables ¶
This section is empty.
Functions ¶
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
func (pl *DynamicResources) PostFilter(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, filteredNodeStatusMap framework.NodeToStatusReader) (*framework.PostFilterResult, *framework.Status)
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
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
func (pl *DynamicResources) PreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) (*framework.PreFilterResult, *framework.Status)
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.