Documentation ¶
Index ¶
- Constants
- func New(obj runtime.Object, handle framework.Handle) (framework.Plugin, error)
- type PreFilterState
- type TopologyScheduling
- func (ts *TopologyScheduling) AddPod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, ...) *framework.Status
- func (ts *TopologyScheduling) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (ts *TopologyScheduling) Name() string
- func (ts *TopologyScheduling) NormalizeScore(ctx context.Context, state *framework.CycleState, p *v1.Pod, ...) *framework.Status
- func (ts *TopologyScheduling) PreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) *framework.Status
- func (ts *TopologyScheduling) PreFilterExtensions() framework.PreFilterExtensions
- func (ts *TopologyScheduling) RemovePod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, ...) *framework.Status
- func (ts *TopologyScheduling) Reserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status
- func (ts *TopologyScheduling) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
- func (ts *TopologyScheduling) ScoreExtensions() framework.ScoreExtensions
- func (ts *TopologyScheduling) Unreserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string)
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 ¶
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) 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) 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)
Click to show internal directories.
Click to hide internal directories.