Documentation ¶
Overview ¶
Package scheduler contains helper function around Daemonset pod scheduling.
Index ¶
- func CheckNodeFitness(logger logr.Logger, pod *corev1.Pod, node *corev1.Node) bool
- func MatchNodeSelectorTerms(nodeSelectorTerms []corev1.NodeSelectorTerm, ...) bool
- func NodeSelectorRequirementsAsFieldSelector(nsm []corev1.NodeSelectorRequirement) (fields.Selector, error)
- func NodeSelectorRequirementsAsSelector(nsm []corev1.NodeSelectorRequirement) (labels.Selector, error)
- func TolerationsTolerateTaint(tolerations []corev1.Toleration, taint *corev1.Taint) bool
- func TolerationsTolerateTaintsWithFilter(tolerations []corev1.Toleration, taints []corev1.Taint, ...) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckNodeFitness ¶
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.