defaultpodtopologyspread

package
v1.18.14 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the name of the plugin used in the plugin registry and configurations.
	Name = "DefaultPodTopologySpread"
)

Variables

This section is empty.

Functions

func New

New initializes a new plugin and returns it.

Types

type DefaultPodTopologySpread

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

DefaultPodTopologySpread is a plugin that calculates selector spread priority.

func (*DefaultPodTopologySpread) Name

func (pl *DefaultPodTopologySpread) Name() string

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

func (*DefaultPodTopologySpread) NormalizeScore

func (pl *DefaultPodTopologySpread) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status

NormalizeScore invoked after scoring all nodes. For this plugin, it calculates the source of each node based on the number of existing matching pods on the node where zone information is included on the nodes, it favors nodes in zones with fewer existing matching pods.

func (*DefaultPodTopologySpread) PreScore added in v1.18.0

func (pl *DefaultPodTopologySpread) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*v1.Node) *framework.Status

PreScore builds and writes cycle state used by Score and NormalizeScore.

func (*DefaultPodTopologySpread) Score

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

Score invoked at the Score extension point. The "score" returned in this function is the matching number of pods on the `nodeName`, it is normalized later.

func (*DefaultPodTopologySpread) ScoreExtensions

func (pl *DefaultPodTopologySpread) ScoreExtensions() framework.ScoreExtensions

ScoreExtensions of the Score plugin.

Jump to

Keyboard shortcuts

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