evictions

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: 19 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HaveEvictAnnotation added in v0.19.0

func HaveEvictAnnotation(pod *v1.Pod) bool

HaveEvictAnnotation checks if the pod have evict annotation

func IsPodEvictableBasedOnPriority added in v0.19.0

func IsPodEvictableBasedOnPriority(pod *v1.Pod, priority int32) bool

IsPodEvictableBasedOnPriority checks if the given pod is evictable based on priority resolved from pod Spec.

func WithLabelSelector added in v0.21.0

func WithLabelSelector(labelSelector labels.Selector) func(opts *Options)

WithLabelSelector sets whether or not to apply label filtering when evicting. Any pod matching the label selector is considered evictable.

func WithNodeFit added in v0.21.0

func WithNodeFit(nodeFit bool) func(opts *Options)

WithNodeFit sets whether or not to consider taints, node selectors, and pod affinity when evicting. A pod whose tolerations, node selectors, and affinity match a node other than the one it is currently running on is evictable.

func WithPriorityThreshold added in v0.19.0

func WithPriorityThreshold(priority int32) func(opts *Options)

WithPriorityThreshold sets a threshold for pod's priority class. Any pod whose priority class is lower is evictable.

Types

type Options added in v0.19.0

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

type PodEvictor added in v0.18.0

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

func NewPodEvictor added in v0.18.0

func NewPodEvictor(
	client clientset.Interface,
	policyGroupVersion string,
	dryRun bool,
	maxPodsToEvictPerNode int,
	nodes []*v1.Node,
	evictLocalStoragePods bool,
	evictSystemCriticalPods bool,
	ignorePvcPods bool,
) *PodEvictor

func (*PodEvictor) EvictPod added in v0.18.0

func (pe *PodEvictor) EvictPod(ctx context.Context, pod *v1.Pod, node *v1.Node, strategy string, reasons ...string) (bool, error)

EvictPod returns non-nil error only when evicting a pod on a node is not possible (due to maxPodsToEvictPerNode constraint). Success is true when the pod is evicted on the server side.

func (*PodEvictor) Evictable added in v0.19.0

func (pe *PodEvictor) Evictable(opts ...func(opts *Options)) *evictable

Evictable provides an implementation of IsEvictable(IsEvictable(pod *v1.Pod) bool). The method accepts a list of options which allow to extend constraints which decides when a pod is considered evictable.

func (*PodEvictor) NodeEvicted added in v0.18.0

func (pe *PodEvictor) NodeEvicted(node *v1.Node) int

NodeEvicted gives a number of pods evicted for node

func (*PodEvictor) TotalEvicted added in v0.18.0

func (pe *PodEvictor) TotalEvicted() int

TotalEvicted gives a number of pods evicted through all nodes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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