Documentation ¶
Index ¶
- Constants
- func GetPodSource(pod *corev1.Pod) (string, error)
- func GetPriorityFromPriorityClass(priorityClassLister schedulingv1.PriorityClassLister, name string) (int32, error)
- func GetPriorityValueFromPriorityThreshold(priorityClassLister schedulingv1.PriorityClassLister, ...) (priority int32, err error)
- func GetResourceRequest(pod *corev1.Pod, resource corev1.ResourceName) int64
- func GetResourceRequestQuantity(pod *corev1.Pod, resourceName corev1.ResourceName) resource.Quantity
- func IsCriticalPriorityPod(pod *corev1.Pod) bool
- func IsDaemonsetPod(ownerRefList []metav1.OwnerReference) bool
- func IsMirrorPod(pod *corev1.Pod) bool
- func IsPodTerminating(pod *corev1.Pod) bool
- func IsPodWithLocalStorage(pod *corev1.Pod) bool
- func IsPodWithPVC(pod *corev1.Pod) bool
- func IsStaticPod(pod *corev1.Pod) bool
- func NodeSelectorsEqual(n1, n2 *corev1.NodeSelector) bool
- func PodMatchNodeSelector(pod *corev1.Pod, node *corev1.Node) (bool, error)
- func TolerationsEqual(t1, t2 []corev1.Toleration) bool
- func TolerationsTolerateTaint(tolerations []corev1.Toleration, taint *corev1.Taint) bool
- func TolerationsTolerateTaintsWithFilter(tolerations []corev1.Toleration, taints []corev1.Taint, ...) bool
Constants ¶
const SystemCriticalPriority = scheduling.SystemCriticalPriority
Variables ¶
This section is empty.
Functions ¶
func GetPodSource ¶
GetPodSource returns the source of the pod based on the annotation.
func GetPriorityFromPriorityClass ¶
func GetPriorityFromPriorityClass(priorityClassLister schedulingv1.PriorityClassLister, name string) (int32, error)
GetPriorityFromPriorityClass gets priority from the given priority class. If no priority class is provided, it will return SystemCriticalPriority by default.
func GetPriorityValueFromPriorityThreshold ¶
func GetPriorityValueFromPriorityThreshold(priorityClassLister schedulingv1.PriorityClassLister, priorityThreshold *deschedulerconfig.PriorityThreshold) (priority int32, err error)
GetPriorityValueFromPriorityThreshold gets priority from the given PriorityThreshold. It will return SystemCriticalPriority by default.
func GetResourceRequest ¶
func GetResourceRequest(pod *corev1.Pod, resource corev1.ResourceName) int64
GetResourceRequest finds and returns the request value for a specific resource.
func GetResourceRequestQuantity ¶
func GetResourceRequestQuantity(pod *corev1.Pod, resourceName corev1.ResourceName) resource.Quantity
GetResourceRequestQuantity finds and returns the request quantity for a specific resource.
func IsCriticalPriorityPod ¶
IsCriticalPriorityPod returns true if the pod has critical priority.
func IsDaemonsetPod ¶
func IsDaemonsetPod(ownerRefList []metav1.OwnerReference) bool
IsDaemonsetPod returns true if the pod is a IsDaemonsetPod.
func IsMirrorPod ¶
IsMirrorPod returns true if the pod is a Mirror Pod.
func IsPodTerminating ¶
IsPodTerminating returns true if the pod DeletionTimestamp is set.
func IsPodWithLocalStorage ¶
IsPodWithLocalStorage returns true if the pod has local storage.
func IsPodWithPVC ¶
IsPodWithPVC returns true if the pod has claimed a persistent volume.
func IsStaticPod ¶
IsStaticPod returns true if the pod is a static pod.
func NodeSelectorsEqual ¶
func NodeSelectorsEqual(n1, n2 *corev1.NodeSelector) bool
func PodMatchNodeSelector ¶
PodMatchNodeSelector checks if a pod node selector matches the node label.
func TolerationsEqual ¶
func TolerationsEqual(t1, t2 []corev1.Toleration) bool
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.