evictions

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvictPod

func EvictPod(ctx context.Context, client clientset.Interface, pod *corev1.Pod, policyGroupVersion string, deleteOptions *metav1.DeleteOptions) error

func HaveEvictAnnotation

func HaveEvictAnnotation(pod *corev1.Pod) bool

HaveEvictAnnotation checks if the pod have evict annotation

func IsPodEvictableBasedOnPriority

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

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

func WithLabelSelector

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

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

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 EvictorFilter

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

func NewEvictorFilter

func NewEvictorFilter(
	nodeGetter nodeGetterFn,
	nodeIndexer podutil.GetPodsAssignedToNodeFunc,
	evictLocalStoragePods bool,
	evictSystemCriticalPods bool,
	ignorePvcPods bool,
	evictFailedBarePods bool,
	opts ...func(opts *Options),
) *EvictorFilter

func (*EvictorFilter) Filter

func (ef *EvictorFilter) Filter(pod *corev1.Pod) bool

Filter decides when a pod is evictable

type Options

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

type PodEvictor

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

func NewPodEvictor

func NewPodEvictor(
	client clientset.Interface,
	eventRecorder events.EventRecorder,
	policyGroupVersion string,
	dryRun bool,
	maxPodsToEvictPerNode *int,
	maxPodsToEvictPerNamespace *int,
) *PodEvictor

func (*PodEvictor) Evict

func (pe *PodEvictor) Evict(ctx context.Context, pod *corev1.Pod, opts framework.EvictOptions) bool

func (*PodEvictor) NamespaceEvicted

func (pe *PodEvictor) NamespaceEvicted(namespace string) int

func (*PodEvictor) NamespaceLimitExceeded

func (pe *PodEvictor) NamespaceLimitExceeded(namespace string) bool

func (*PodEvictor) NodeEvicted

func (pe *PodEvictor) NodeEvicted(nodeName string) int

NodeEvicted gives a number of pods evicted for node

func (*PodEvictor) NodeLimitExceeded

func (pe *PodEvictor) NodeLimitExceeded(nodeName string) bool

NodeLimitExceeded checks if the number of evictions for a node was exceeded

func (*PodEvictor) TotalEvicted

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