Documentation ¶
Index ¶
- Constants
- func New(_ context.Context, dpArgs runtime.Object, fh framework.Handle, ...) (framework.Plugin, error)
- type DefaultPreemption
- func (pl *DefaultPreemption) CandidatesToVictimsMap(candidates []preemption.Candidate) map[string]*extenderv1.Victims
- func (pl *DefaultPreemption) EventsToRegister(_ context.Context) ([]framework.ClusterEventWithHint, error)
- func (pl *DefaultPreemption) GetOffsetAndNumCandidates(numNodes int32) (int32, int32)
- func (pl *DefaultPreemption) Name() string
- func (pl *DefaultPreemption) OrderedScoreFuncs(ctx context.Context, nodesToVictims map[string]*extenderv1.Victims) []func(node string) int64
- func (pl *DefaultPreemption) PodEligibleToPreemptOthers(_ context.Context, pod *v1.Pod, nominatedNodeStatus *framework.Status) (bool, string)
- func (pl *DefaultPreemption) PostFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, ...) (*framework.PostFilterResult, *framework.Status)
- func (pl *DefaultPreemption) PreEnqueue(ctx context.Context, p *v1.Pod) *framework.Status
- func (pl *DefaultPreemption) SelectVictimsOnNode(ctx context.Context, state *framework.CycleState, pod *v1.Pod, ...) ([]*v1.Pod, int, *framework.Status)
Constants ¶
const Name = names.DefaultPreemption
Name of the plugin used in the plugin registry and configurations.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultPreemption ¶
type DefaultPreemption struct { Evaluator *preemption.Evaluator // contains filtered or unexported fields }
DefaultPreemption is a PostFilter plugin implements the preemption logic.
func (*DefaultPreemption) CandidatesToVictimsMap ¶ added in v1.23.0
func (pl *DefaultPreemption) CandidatesToVictimsMap(candidates []preemption.Candidate) map[string]*extenderv1.Victims
This function is not applicable for out-of-tree preemption plugins that exercise different preemption candidates on the same nominated node.
func (*DefaultPreemption) EventsToRegister ¶ added in v1.32.0
func (pl *DefaultPreemption) EventsToRegister(_ context.Context) ([]framework.ClusterEventWithHint, error)
EventsToRegister returns the possible events that may make a Pod failed by this plugin schedulable.
func (*DefaultPreemption) GetOffsetAndNumCandidates ¶ added in v1.23.0
func (pl *DefaultPreemption) GetOffsetAndNumCandidates(numNodes int32) (int32, int32)
GetOffsetAndNumCandidates chooses a random offset and calculates the number of candidates that should be shortlisted for dry running preemption.
func (*DefaultPreemption) Name ¶
func (pl *DefaultPreemption) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*DefaultPreemption) OrderedScoreFuncs ¶ added in v1.29.0
func (pl *DefaultPreemption) OrderedScoreFuncs(ctx context.Context, nodesToVictims map[string]*extenderv1.Victims) []func(node string) int64
OrderedScoreFuncs returns a list of ordered score functions to select preferable node where victims will be preempted.
func (*DefaultPreemption) PodEligibleToPreemptOthers ¶ added in v1.23.0
func (pl *DefaultPreemption) PodEligibleToPreemptOthers(_ context.Context, pod *v1.Pod, nominatedNodeStatus *framework.Status) (bool, string)
PodEligibleToPreemptOthers returns one bool and one string. The bool indicates whether this pod should be considered for preempting other pods or not. The string includes the reason if this pod isn't eligible. There're several reasons:
- The pod has a preemptionPolicy of Never.
- The pod has already preempted other pods and the victims are in their graceful termination period. Currently we check the node that is nominated for this pod, and as long as there are terminating pods on this node, we don't attempt to preempt more pods.
func (*DefaultPreemption) PostFilter ¶
func (pl *DefaultPreemption) PostFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, m framework.NodeToStatusReader) (*framework.PostFilterResult, *framework.Status)
PostFilter invoked at the postFilter extension point.
func (*DefaultPreemption) PreEnqueue ¶ added in v1.32.0
func (*DefaultPreemption) SelectVictimsOnNode ¶ added in v1.23.0
func (pl *DefaultPreemption) SelectVictimsOnNode( ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo, pdbs []*policy.PodDisruptionBudget) ([]*v1.Pod, int, *framework.Status)
SelectVictimsOnNode finds minimum set of pods on the given node that should be preempted in order to make enough room for "pod" to be scheduled.