predicate

package
v0.0.0-...-7b64836 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PredicateSnapshot

type PredicateSnapshot struct {
	clustersnapshot.ClusterSnapshotStore
	// contains filtered or unexported fields
}

PredicateSnapshot implements ClusterSnapshot on top of a ClusterSnapshotStore by using SchedulerBasedPredicateChecker to check scheduler predicates.

func NewPredicateSnapshot

func NewPredicateSnapshot(snapshotStore clustersnapshot.ClusterSnapshotStore, fwHandle *framework.Handle, draEnabled bool) *PredicateSnapshot

NewPredicateSnapshot builds a PredicateSnapshot.

func (*PredicateSnapshot) AddNodeInfo

func (s *PredicateSnapshot) AddNodeInfo(nodeInfo *framework.NodeInfo) error

AddNodeInfo adds the provided internal NodeInfo to the snapshot.

func (*PredicateSnapshot) CheckPredicates

func (s *PredicateSnapshot) CheckPredicates(pod *apiv1.Pod, nodeName string) clustersnapshot.SchedulingError

CheckPredicates checks whether scheduler predicates pass for the given pod on the given node.

func (*PredicateSnapshot) GetNodeInfo

func (s *PredicateSnapshot) GetNodeInfo(nodeName string) (*framework.NodeInfo, error)

GetNodeInfo returns an internal NodeInfo wrapping the relevant schedulerframework.NodeInfo.

func (*PredicateSnapshot) ListNodeInfos

func (s *PredicateSnapshot) ListNodeInfos() ([]*framework.NodeInfo, error)

ListNodeInfos returns internal NodeInfos wrapping all schedulerframework.NodeInfos in the snapshot.

func (*PredicateSnapshot) RemoveNodeInfo

func (s *PredicateSnapshot) RemoveNodeInfo(nodeName string) error

RemoveNodeInfo removes a NodeInfo matching the provided nodeName from the snapshot.

func (*PredicateSnapshot) SchedulePod

func (s *PredicateSnapshot) SchedulePod(pod *apiv1.Pod, nodeName string) clustersnapshot.SchedulingError

SchedulePod adds pod to the snapshot and schedules it to given node.

func (*PredicateSnapshot) SchedulePodOnAnyNodeMatching

func (s *PredicateSnapshot) SchedulePodOnAnyNodeMatching(pod *apiv1.Pod, anyNodeMatching func(*framework.NodeInfo) bool) (string, clustersnapshot.SchedulingError)

SchedulePodOnAnyNodeMatching adds pod to the snapshot and schedules it to any node matching the provided function.

func (*PredicateSnapshot) UnschedulePod

func (s *PredicateSnapshot) UnschedulePod(namespace string, podName string, nodeName string) error

UnschedulePod removes the given Pod from the given Node inside the snapshot.

type SchedulerPluginRunner

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

SchedulerPluginRunner can be used to run various phases of scheduler plugins through the scheduler framework.

func NewSchedulerPluginRunner

func NewSchedulerPluginRunner(fwHandle *framework.Handle, snapshot clustersnapshot.ClusterSnapshot) *SchedulerPluginRunner

NewSchedulerPluginRunner builds a SchedulerPluginRunner.

func (*SchedulerPluginRunner) RunFiltersOnNode

RunFiltersOnNode runs the scheduler framework PreFilter and Filter phases to check if the given pod can be scheduled on the given node.

func (*SchedulerPluginRunner) RunFiltersUntilPassingNode

func (p *SchedulerPluginRunner) RunFiltersUntilPassingNode(pod *apiv1.Pod, nodeMatches func(*framework.NodeInfo) bool) (*apiv1.Node, *schedulerframework.CycleState, clustersnapshot.SchedulingError)

RunFiltersUntilPassingNode runs the scheduler framework PreFilter phase once, and then keeps running the Filter phase for all nodes in the cluster that match the provided function - until a Node where the Filters pass is found. Filters are only run for matching Nodes. If no matching Node with passing Filters is found, an error is returned.

The node iteration always starts from the next Node from the last Node that was found by this method. TODO: Extract the iteration strategy out of SchedulerPluginRunner.

func (*SchedulerPluginRunner) RunReserveOnNode

func (p *SchedulerPluginRunner) RunReserveOnNode(pod *apiv1.Pod, nodeName string, postFilterState *schedulerframework.CycleState) error

RunReserveOnNode runs the scheduler framework Reserve phase to update the scheduler plugins state to reflect the Pod being scheduled on the Node.

Jump to

Keyboard shortcuts

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