Documentation
¶
Index ¶
- func EvictPod(ctx context.Context, client clientset.Interface, pod *corev1.Pod, ...) error
- func HaveEvictAnnotation(pod *corev1.Pod) bool
- func IsPodEvictableBasedOnPriority(pod *corev1.Pod, priority int32) bool
- func WithLabelSelector(labelSelector labels.Selector) func(opts *Options)
- func WithNodeFit(nodeFit bool) func(opts *Options)
- func WithPriorityThreshold(priority int32) func(opts *Options)
- type EvictorFilter
- type Options
- type PodEvictor
- func (pe *PodEvictor) Evict(ctx context.Context, pod *corev1.Pod, opts framework.EvictOptions) bool
- func (pe *PodEvictor) NamespaceEvicted(namespace string) int
- func (pe *PodEvictor) NamespaceLimitExceeded(namespace string) bool
- func (pe *PodEvictor) NodeEvicted(nodeName string) int
- func (pe *PodEvictor) NodeLimitExceeded(nodeName string) bool
- func (pe *PodEvictor) TotalEvicted() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HaveEvictAnnotation ¶
HaveEvictAnnotation checks if the pod have evict annotation
func IsPodEvictableBasedOnPriority ¶
IsPodEvictableBasedOnPriority checks if the given pod is evictable based on priority resolved from pod Spec.
func WithLabelSelector ¶
WithLabelSelector sets whether or not to apply label filtering when evicting. Any pod matching the label selector is considered evictable.
func WithNodeFit ¶
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 ¶
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
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