defaultpreemption

package
v1.24.11 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 23 Imported by: 10

Documentation

Index

Constants

View Source
const (
	// Name of the plugin used in the plugin registry and configurations.
	Name = names.DefaultPreemption
)

Variables

This section is empty.

Functions

func New

New initializes a new plugin and returns it.

Types

type DefaultPreemption

type DefaultPreemption struct {
	// 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) 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) PodEligibleToPreemptOthers added in v1.23.0

func (pl *DefaultPreemption) PodEligibleToPreemptOthers(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. If this pod has a preemptionPolicy of Never or has already preempted other pods and those are in their graceful termination period, it shouldn't be considered for preemption. We look at the node that is nominated for this pod and as long as there are terminating pods on the node, we don't consider this for preempting more pods.

func (*DefaultPreemption) PostFilter

PostFilter invoked at the postFilter extension point.

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.

Jump to

Keyboard shortcuts

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