Name of the plugin used in the plugin registry and configurations.
const Name = names.DefaultPreemption
func New(_ context.Context, dpArgs runtime.Object, fh framework.Handle, fts feature.Features) (framework.Plugin, error)
New initializes a new plugin and returns it.
DefaultPreemption is a PostFilter plugin implements the preemption logic.
type DefaultPreemption struct {
// contains filtered or unexported fields
}
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 (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 (pl *DefaultPreemption) Name() string
Name returns name of the plugin. It is used in logs, etc.
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 (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. There're several reasons:
func (pl *DefaultPreemption) PostFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, m framework.NodeToStatusMap) (*framework.PostFilterResult, *framework.Status)
PostFilter invoked at the postFilter extension point.
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.