nodes

package
v0.0.0-...-4463c60 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicResizeFilteringProcessor

type AtomicResizeFilteringProcessor struct {
}

AtomicResizeFilteringProcessor removes node groups which should be scaled down as one unit if only part of these nodes were scheduled for scale down. NOTE! When chaining with other processors, AtomicResizeFilteringProcessors should be always used last. Otherwise, it's possible that another processor will break the property that this processor aims to restore: no partial scale-downs for node groups that should be resized atomically.

func NewAtomicResizeFilteringProcessor

func NewAtomicResizeFilteringProcessor() *AtomicResizeFilteringProcessor

NewAtomicResizeFilteringProcessor returns a new AtomicResizeFilteringProcessor

func (*AtomicResizeFilteringProcessor) CleanUp

func (p *AtomicResizeFilteringProcessor) CleanUp()

CleanUp is called at CA termination

func (*AtomicResizeFilteringProcessor) FilterUnremovableNodes

FilterUnremovableNodes marks all candidate nodes as unremovable if ZeroOrMaxNodeScaling is enabled and number of nodes to remove are not equal to target size

type CompositeScaleDownSetProcessor

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

CompositeScaleDownSetProcessor is a ScaleDownSetProcessor composed of multiple sub-processors passed as an argument.

func NewCompositeScaleDownSetProcessor

func NewCompositeScaleDownSetProcessor(orderedProcessorList []ScaleDownSetProcessor) *CompositeScaleDownSetProcessor

NewCompositeScaleDownSetProcessor creates new CompositeScaleDownSetProcessor. The order on a list defines order in witch sub-processors are invoked.

func (*CompositeScaleDownSetProcessor) CleanUp

func (p *CompositeScaleDownSetProcessor) CleanUp()

CleanUp is called at CA termination

func (*CompositeScaleDownSetProcessor) FilterUnremovableNodes

FilterUnremovableNodes filters the passed removable candidates from unremovable nodes by calling orderedProcessorList in order

type PreFilteringScaleDownNodeProcessor

type PreFilteringScaleDownNodeProcessor struct {
}

PreFilteringScaleDownNodeProcessor filters out scale down candidates from nodegroup with size <= minimum number of nodes for that nodegroup and filters out node from non-autoscaled nodegroups

func NewPreFilteringScaleDownNodeProcessor

func NewPreFilteringScaleDownNodeProcessor() *PreFilteringScaleDownNodeProcessor

NewPreFilteringScaleDownNodeProcessor returns a new PreFilteringScaleDownNodeProcessor.

func (*PreFilteringScaleDownNodeProcessor) CleanUp

CleanUp is called at CA termination.

func (*PreFilteringScaleDownNodeProcessor) GetPodDestinationCandidates

func (n *PreFilteringScaleDownNodeProcessor) GetPodDestinationCandidates(ctx *context.AutoscalingContext,
	nodes []*apiv1.Node) ([]*apiv1.Node, errors.AutoscalerError)

GetPodDestinationCandidates returns nodes that potentially could act as destinations for pods that would become unscheduled after a scale down.

func (*PreFilteringScaleDownNodeProcessor) GetScaleDownCandidates

GetScaleDownCandidates returns nodes that potentially could be scaled down and

type ScaleDownContext

type ScaleDownContext struct {
	ActuationStatus     scaledown.ActuationStatus
	ResourcesLeft       resource.Limits
	ResourcesWithLimits []string
}

ScaleDownContext keeps an updated version actuationStatus and resourcesLeft for the scaling down process

func NewDefaultScaleDownContext

func NewDefaultScaleDownContext() *ScaleDownContext

NewDefaultScaleDownContext returns ScaleDownContext with passed MaxNodeCountToBeRemoved

type ScaleDownNodeProcessor

type ScaleDownNodeProcessor interface {
	// GetPodDestinationCandidates returns nodes that potentially could act as destinations for pods
	// that would become unscheduled after a scale down.
	GetPodDestinationCandidates(*context.AutoscalingContext, []*apiv1.Node) ([]*apiv1.Node, errors.AutoscalerError)
	// GetScaleDownCandidates returns nodes that potentially could be scaled down.
	GetScaleDownCandidates(*context.AutoscalingContext, []*apiv1.Node) ([]*apiv1.Node, errors.AutoscalerError)
	// CleanUp is called at CA termination
	CleanUp()
}

ScaleDownNodeProcessor contains methods to get harbor and scale down candidate nodes

type ScaleDownSetProcessor

type ScaleDownSetProcessor interface {
	// FilterUnremovableNodes divides all candidates into removable nodes and unremovable nodes with reason
	// Note that len(removableNodes) + len(unremovableNode) should equal len(candidates)
	// in other words, each candidate should end up in one and only one of the resulting node lists.
	FilterUnremovableNodes(ctx *context.AutoscalingContext, scaleDownCtx *ScaleDownContext, candidates []simulator.NodeToBeRemoved) ([]simulator.NodeToBeRemoved, []simulator.UnremovableNode)
	// CleanUp is called at CA termination
	CleanUp()
}

ScaleDownSetProcessor contains a method to select nodes for deletion

Jump to

Keyboard shortcuts

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