nodelabel

package
v1.18.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ErrReasonPresenceViolated is used for CheckNodeLabelPresence predicate error.
	ErrReasonPresenceViolated = "node(s) didn't have the requested labels"
)
View Source
const Name = "NodeLabel"

Name of this plugin.

Variables

This section is empty.

Functions

func New

New initializes a new plugin and returns it.

Types

type Args

type Args struct {
	// PresentLabels should be present for the node to be considered a fit for hosting the pod
	PresentLabels []string `json:"presentLabels,omitempty"`
	// AbsentLabels should be absent for the node to be considered a fit for hosting the pod
	AbsentLabels []string `json:"absentLabels,omitempty"`
	// Nodes that have labels in the list will get a higher score.
	PresentLabelsPreference []string `json:"presentLabelsPreference,omitempty"`
	// Nodes that don't have labels in the list will get a higher score.
	AbsentLabelsPreference []string `json:"absentLabelsPreference,omitempty"`
}

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

type NodeLabel

type NodeLabel struct {
	Args
	// contains filtered or unexported fields
}

NodeLabel checks whether a pod can fit based on the node labels which match a filter that it requests.

func (*NodeLabel) Filter

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

Filter invoked at the filter extension point. It checks whether all of the specified labels exists on a node or not, regardless of their value

Consider the cases where the nodes are placed in regions/zones/racks and these are identified by labels In some cases, it is required that only nodes that are part of ANY of the defined regions/zones/racks be selected

Alternately, eliminating nodes that have a certain label, regardless of value, is also useful A node may have a label with "retiring" as key and the date as the value and it may be desirable to avoid scheduling new pods on this node.

func (*NodeLabel) Name

func (pl *NodeLabel) Name() string

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

func (*NodeLabel) Score

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

Score invoked at the score extension point.

func (*NodeLabel) ScoreExtensions

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