Documentation ¶
Index ¶
- func HaveEvictAnnotation(pod *v1.Pod) bool
- func IsPodEvictableBasedOnPriority(pod *v1.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 Options
- type PodEvictor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HaveEvictAnnotation ¶ added in v0.19.0
HaveEvictAnnotation checks if the pod have evict annotation
func IsPodEvictableBasedOnPriority ¶ added in v0.19.0
IsPodEvictableBasedOnPriority checks if the given pod is evictable based on priority resolved from pod Spec.
func WithLabelSelector ¶ added in v0.21.0
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
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
WithPriorityThreshold sets a threshold for pod's priority class. Any pod whose priority class is lower is evictable.
Types ¶
type PodEvictor ¶ added in v0.18.0
type PodEvictor struct {
// contains filtered or unexported fields
}
func NewPodEvictor ¶ added in v0.18.0
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