topologyscheduling

package
v0.0.0-...-3dc4fa0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrReasonConstraintsNotMatch is used for PodTopologySpread filter error.
	ErrReasonConstraintsNotMatch = "node(s) didn't match pod topology spread constraints"
	// ErrReasonNodeLabelNotMatch is used when the node doesn't hold the required label.
	ErrReasonNodeLabelNotMatch = ErrReasonConstraintsNotMatch + " (missing required label)"
)
View Source
const (
	// Name is the name of the plugin used in Registry and configurations.
	Name = "TopologyScheduling"
)

Variables

This section is empty.

Functions

func New

func New(obj runtime.Object, handle framework.Handle) (framework.Plugin, error)

New initializes a new plugin and returns it.

Types

type PreFilterState

type PreFilterState struct {
	Constraint common.TopologySchedulingConstraint
	// TpPairToMatchNum is keyed with TopologyPair, and valued with the number of matching pods.
	TpPairToMatchNum map[common.TopologyPair]*int32
	// ScheduleStrategy can be Balance or Fill
	ScheduleStrategy string
}

PreFilterState computed at PreFilter and used at PostFilter or Reserve.

func (*PreFilterState) Clone

func (s *PreFilterState) Clone() framework.StateData

Clone the preFilter state.

type TopologyScheduling

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

TopologyScheduling is a plugin that implements the mechanism of capacity scheduling.

func (*TopologyScheduling) AddPod

func (ts *TopologyScheduling) AddPod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod,
	podToAdd *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status

AddPod from pre-computed data in cycleState.

func (*TopologyScheduling) Filter

func (ts *TopologyScheduling) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod,
	nodeInfo *framework.NodeInfo) *framework.Status

func (*TopologyScheduling) Name

func (ts *TopologyScheduling) Name() string

Name returns name of the plugin. It is used in logs, etc.

func (*TopologyScheduling) NormalizeScore

func (ts *TopologyScheduling) NormalizeScore(ctx context.Context, state *framework.CycleState, p *v1.Pod,
	scores framework.NodeScoreList) *framework.Status

func (*TopologyScheduling) PreFilter

func (ts *TopologyScheduling) PreFilter(ctx context.Context, state *framework.CycleState,
	pod *v1.Pod) *framework.Status

PreFilter performs the following validations. 1. Check if the (pod.request + eq.allocated) is less than eq.max. 2. Check if the sum(eq's usage) > sum(eq's min).

func (*TopologyScheduling) PreFilterExtensions

func (ts *TopologyScheduling) PreFilterExtensions() framework.PreFilterExtensions

PreFilterExtensions returns prefilter extensions, pod add and remove.

func (*TopologyScheduling) RemovePod

func (ts *TopologyScheduling) RemovePod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod,
	podToRemove *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status

RemovePod from pre-computed data in cycleState.

func (*TopologyScheduling) Reserve

func (ts *TopologyScheduling) Reserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod,
	nodeName string) *framework.Status

func (*TopologyScheduling) Score

func (ts *TopologyScheduling) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod,
	nodeName string) (int64, *framework.Status)

func (*TopologyScheduling) ScoreExtensions

func (ts *TopologyScheduling) ScoreExtensions() framework.ScoreExtensions

func (*TopologyScheduling) Unreserve

func (ts *TopologyScheduling) Unreserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string)

Jump to

Keyboard shortcuts

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