pod

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBestEffortPod

func IsBestEffortPod(pod *corev1.Pod) bool

func IsBurstablePod

func IsBurstablePod(pod *corev1.Pod) bool

func IsGuaranteedPod

func IsGuaranteedPod(pod *corev1.Pod) bool

func ListAllPodsOnANode

func ListAllPodsOnANode(
	nodeName string,
	getPodsAssignedToNode GetPodsAssignedToNodeFunc,
	filter FilterFunc,
) ([]*corev1.Pod, error)

ListAllPodsOnANode lists all the pods on a node no matter what the phase of the pod is.

func ListPodsOnANode

func ListPodsOnANode(
	nodeName string,
	getPodsAssignedToNode GetPodsAssignedToNodeFunc,
	filter FilterFunc,
) ([]*corev1.Pod, error)

ListPodsOnANode lists all pods on a node. It also accepts a "filter" function which can be used to further limit the pods that are returned. (Usually this is podEvictor.Evictable().IsEvictable, in order to only list the evictable pods on a node, but can be used by strategies to extend it if there are further restrictions, such as with NodeAffinity).

func OwnerRef

func OwnerRef(pod *corev1.Pod) []metav1.OwnerReference

OwnerRef returns the ownerRefList for the pod.

func SortPodsBasedOnAge

func SortPodsBasedOnAge(pods []*corev1.Pod)

SortPodsBasedOnAge sorts Pods from oldest to most recent in place

func SortPodsBasedOnPriorityLowToHigh

func SortPodsBasedOnPriorityLowToHigh(pods []*corev1.Pod)

SortPodsBasedOnPriorityLowToHigh sorts pods based on their priorities from low to high. If pods have same priorities, they will be sorted by QoS in the following order: BestEffort, Burstable, Guaranteed

Types

type FilterFunc

type FilterFunc = framework.FilterFunc

FilterFunc is a filter for a pod.

func WrapFilterFuncs

func WrapFilterFuncs(filters ...FilterFunc) FilterFunc

WrapFilterFuncs wraps a set of FilterFunc in one.

type GetPodsAssignedToNodeFunc

type GetPodsAssignedToNodeFunc = framework.GetPodsAssignedToNodeFunc

GetPodsAssignedToNodeFunc is a function which accept a node name and a pod filter function as input and returns the pods that assigned to the node.

type Options

type Options struct {
	// contains filtered or unexported fields
}

func NewOptions

func NewOptions() *Options

NewOptions returns an empty Options.

func (*Options) BuildFilterFunc

func (o *Options) BuildFilterFunc() (FilterFunc, error)

BuildFilterFunc builds a final FilterFunc based on Options.

func (*Options) WithFilter

func (o *Options) WithFilter(filter FilterFunc) *Options

WithFilter sets a pod filter. The filter function should return true if the pod should be returned from ListPodsOnANode

func (*Options) WithLabelSelector

func (o *Options) WithLabelSelector(labelSelector *metav1.LabelSelector) *Options

WithLabelSelector sets a pod label selector

func (*Options) WithNamespaces

func (o *Options) WithNamespaces(namespaces sets.String) *Options

WithNamespaces sets included namespaces

func (*Options) WithoutNamespaces

func (o *Options) WithoutNamespaces(namespaces sets.String) *Options

WithoutNamespaces sets excluded namespaces

Jump to

Keyboard shortcuts

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