serviceaffinity

package
v1.17.1-beta.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "ServiceAffinity"

Name is the name of the plugin used in the plugin registry and configurations.

Variables

This section is empty.

Functions

func New

New initializes a new plugin and returns it.

Types

type Args

type Args struct {
	// Labels are homogeneous for pods that are scheduled to a node.
	// (i.e. it returns true IFF this pod can be added to this node such that all other pods in
	// the same service are running on nodes with the exact same values for Labels).
	AffinityLabels []string `json:"labels,omitempty"`
	// AntiAffinityLabelsPreference are the labels to consider for service anti affinity scoring.
	AntiAffinityLabelsPreference []string `json:"antiAffinityLabelsPreference,omitempty"`
}

Args holds the args that are used to configure the plugin.

type ServiceAffinity

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

ServiceAffinity is a plugin that checks service affinity.

func (*ServiceAffinity) Filter

func (pl *ServiceAffinity) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeInfo *nodeinfo.NodeInfo) *framework.Status

Filter invoked at the filter extension point.

func (*ServiceAffinity) Name

func (pl *ServiceAffinity) Name() string

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

func (*ServiceAffinity) NormalizeScore

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

NormalizeScore invoked after scoring all nodes.

func (*ServiceAffinity) Score

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

Score invoked at the Score extension point.

func (*ServiceAffinity) ScoreExtensions

func (pl *ServiceAffinity) 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