Documentation ¶
Index ¶
- Constants
- func EvictPod(ctx context.Context, client clientset.Interface, pod *corev1.Pod, ...) error
- func HaveEvictAnnotation(obj metav1.Object) 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 EvictionLimiter
- func (pe *EvictionLimiter) AllowEvict(pod *corev1.Pod) bool
- func (pe *EvictionLimiter) Done(pod *corev1.Pod)
- func (pe *EvictionLimiter) NamespaceEvicted(namespace string) uint
- func (pe *EvictionLimiter) NamespaceLimitExceeded(namespace string) bool
- func (pe *EvictionLimiter) NodeEvicted(nodeName string) uint
- func (pe *EvictionLimiter) NodeLimitExceeded(node *corev1.Node) bool
- func (pe *EvictionLimiter) Reset()
- func (pe *EvictionLimiter) TotalEvicted() uint
- 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) uint
- func (pe *PodEvictor) NamespaceLimitExceeded(namespace string) bool
- func (pe *PodEvictor) NodeEvicted(nodeName string) uint
- func (pe *PodEvictor) NodeLimitExceeded(nodeName string) bool
- func (pe *PodEvictor) TotalEvicted() int
Constants ¶
const (
EvictPodAnnotationKey = "descheduler.alpha.kubernetes.io/evict"
)
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 EvictionLimiter ¶ added in v1.2.0
type EvictionLimiter struct {
// contains filtered or unexported fields
}
func NewEvictionLimiter ¶ added in v1.2.0
func NewEvictionLimiter( maxPodsToEvictPerNode *uint, maxPodsToEvictPerNamespace *uint, ) *EvictionLimiter
func (*EvictionLimiter) AllowEvict ¶ added in v1.2.0
func (pe *EvictionLimiter) AllowEvict(pod *corev1.Pod) bool
func (*EvictionLimiter) Done ¶ added in v1.2.0
func (pe *EvictionLimiter) Done(pod *corev1.Pod)
func (*EvictionLimiter) NamespaceEvicted ¶ added in v1.2.0
func (pe *EvictionLimiter) NamespaceEvicted(namespace string) uint
func (*EvictionLimiter) NamespaceLimitExceeded ¶ added in v1.2.0
func (pe *EvictionLimiter) NamespaceLimitExceeded(namespace string) bool
func (*EvictionLimiter) NodeEvicted ¶ added in v1.2.0
func (pe *EvictionLimiter) NodeEvicted(nodeName string) uint
NodeEvicted gives a number of pods evicted for node
func (*EvictionLimiter) NodeLimitExceeded ¶ added in v1.2.0
func (pe *EvictionLimiter) NodeLimitExceeded(node *corev1.Node) bool
NodeLimitExceeded checks if the number of evictions for a node was exceeded
func (*EvictionLimiter) Reset ¶ added in v1.2.0
func (pe *EvictionLimiter) Reset()
func (*EvictionLimiter) TotalEvicted ¶ added in v1.2.0
func (pe *EvictionLimiter) TotalEvicted() uint
TotalEvicted gives a number of pods evicted through all nodes
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 *uint, maxPodsToEvictPerNamespace *uint, ) *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) uint
func (*PodEvictor) NamespaceLimitExceeded ¶
func (pe *PodEvictor) NamespaceLimitExceeded(namespace string) bool
func (*PodEvictor) NodeEvicted ¶
func (pe *PodEvictor) NodeEvicted(nodeName string) uint
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