component-helpersk8s.io/component-helpers/scheduling/corev1 Index | Files | Directories

package corev1

import "k8s.io/component-helpers/scheduling/corev1"

Package corev1 defines functions which should satisfy one of the following:

- Be used by more than one core component (kube-scheduler, kubelet, kube-apiserver, etc.) - Be used by a core component and another kubernetes project (cluster-autoscaler, descheduler)

And be a scheduling feature.

Index

Functions

func FindMatchingUntoleratedTaint

func FindMatchingUntoleratedTaint(taints []v1.Taint, tolerations []v1.Toleration, inclusionFilter taintsFilterFunc) (v1.Taint, bool)

FindMatchingUntoleratedTaint checks if the given tolerations tolerates all the filtered taints, and returns the first taint without a toleration Returns true if there is an untolerated taint Returns false if all taints are tolerated

func GetAvoidPodsFromNodeAnnotations

func GetAvoidPodsFromNodeAnnotations(annotations map[string]string) (v1.AvoidPods, error)

GetAvoidPodsFromNodeAnnotations scans the list of annotations and returns the pods that needs to be avoided for this node from scheduling

func MatchNodeSelectorTerms

func MatchNodeSelectorTerms(
	node *v1.Node,
	nodeSelector *v1.NodeSelector,
) (bool, error)

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

func PodPriority

func PodPriority(pod *v1.Pod) int32

PodPriority returns priority of the given pod.

func TolerationsTolerateTaint

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

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

Source Files

doc.go helpers.go

Directories

PathSynopsis
scheduling/corev1/nodeaffinity
Version
v0.32.2 (latest)
Published
Feb 13, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
2 months ago

Tools for package owners.