scheduler

package
v0.7.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package scheduler contains helper function around Daemonset pod scheduling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNodeFitness

func CheckNodeFitness(logger logr.Logger, pod *corev1.Pod, node *corev1.Node) bool

CheckNodeFitness runs a set of predicates that select candidate nodes for the DaemonSet; the predicates include:

  • PodMatchNodeSelector: checks pod's NodeSelector and NodeAffinity against node
  • PodToleratesNodeTaints: exclude tainted node unless pod has specific toleration

func MatchNodeSelectorTerms

func MatchNodeSelectorTerms(
	nodeSelectorTerms []corev1.NodeSelectorTerm,
	nodeLabels, nodeFields labels.Labels,
) bool

MatchNodeSelectorTerms checks whether the node labels and fields match node selector terms in ORed; nil or empty term matches no objects.

func NodeSelectorRequirementsAsFieldSelector

func NodeSelectorRequirementsAsFieldSelector(nsm []corev1.NodeSelectorRequirement) (fields.Selector, error)

NodeSelectorRequirementsAsFieldSelector converts the []NodeSelectorRequirement core type into a struct that implements fields.Selector.

func NodeSelectorRequirementsAsSelector

func NodeSelectorRequirementsAsSelector(nsm []corev1.NodeSelectorRequirement) (labels.Selector, error)

NodeSelectorRequirementsAsSelector converts the []NodeSelectorRequirement api type into a struct that implements labels.Selector.

func TolerationsTolerateTaint

func TolerationsTolerateTaint(tolerations []corev1.Toleration, taint *corev1.Taint) bool

TolerationsTolerateTaint checks if taint is tolerated by any of the tolerations.

func TolerationsTolerateTaintsWithFilter

func TolerationsTolerateTaintsWithFilter(tolerations []corev1.Toleration, taints []corev1.Taint, applyFilter taintsFilterFunc) bool

TolerationsTolerateTaintsWithFilter checks if given tolerations tolerates all the taints that apply to the filter in given taint list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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