pod

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBestEffortPod

func IsBestEffortPod(pod *v1.Pod) bool

func IsBurstablePod

func IsBurstablePod(pod *v1.Pod) bool

func IsGuaranteedPod

func IsGuaranteedPod(pod *v1.Pod) bool

func ListPodsOnANode

func ListPodsOnANode(
	ctx context.Context,
	client clientset.Interface,
	node *v1.Node,
	opts ...func(opts *Options),
) ([]*v1.Pod, error)

ListPodsOnANode lists all of the pods on a node It also accepts an optional "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 ListPodsOnANodeWithFieldSelector added in v0.22.0

func ListPodsOnANodeWithFieldSelector(
	ctx context.Context,
	client clientset.Interface,
	node *v1.Node,
	fieldSelectorString string,
	opts ...func(opts *Options),
) ([]*v1.Pod, error)

ListPodsOnANodeWithFieldSelector lists all of the pods on a node using the filter selectors

func OwnerRef added in v0.4.0

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

OwnerRef returns the ownerRefList for the pod.

func SortPodsBasedOnPriorityLowToHigh added in v0.19.0

func SortPodsBasedOnPriorityLowToHigh(pods []*v1.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

func WithFilter added in v0.19.0

func WithFilter(filter func(pod *v1.Pod) bool) func(opts *Options)

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

func WithLabelSelector added in v0.21.0

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

WithLabelSelector sets a pod label selector

func WithNamespaces added in v0.19.0

func WithNamespaces(namespaces []string) func(opts *Options)

WithNamespaces sets included namespaces

func WithoutNamespaces added in v0.19.0

func WithoutNamespaces(namespaces []string) func(opts *Options)

WithoutNamespaces sets excluded namespaces

Types

type Options added in v0.19.0

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

Jump to

Keyboard shortcuts

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