Documentation ¶
Index ¶
Constants ¶
const (
// NodeUpcomingAnnotation is an annotation CA adds to nodes which are upcoming.
NodeUpcomingAnnotation = "cluster-autoscaler.k8s.io/upcoming-node"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Autoscaler ¶
type Autoscaler interface { // Start starts components running in background. Start() error // RunOnce represents an iteration in the control-loop of CA RunOnce(currentTime time.Time) errors.AutoscalerError // ExitCleanUp is a clean-up performed just before process termination. ExitCleanUp() // LastScaleUpTime is a time of the last scale up LastScaleUpTime() time.Time // LastScaleUpTime is a time of the last scale down LastScaleDownDeleteTime() time.Time }
Autoscaler is the main component of CA which scales up/down node groups according to its configuration The configuration can be injected at the creation of an autoscaler
func NewAutoscaler ¶
func NewAutoscaler(opts AutoscalerOptions, informerFactory informers.SharedInformerFactory) (Autoscaler, errors.AutoscalerError)
NewAutoscaler creates an autoscaler of an appropriate type according to the parameters
type AutoscalerOptions ¶
type AutoscalerOptions struct { config.AutoscalingOptions KubeClient kube_client.Interface InformerFactory informers.SharedInformerFactory AutoscalingKubeClients *context.AutoscalingKubeClients CloudProvider cloudprovider.CloudProvider FrameworkHandle *framework.Handle ClusterSnapshot clustersnapshot.ClusterSnapshot ExpanderStrategy expander.Strategy EstimatorBuilder estimator.EstimatorBuilder Processors *ca_processors.AutoscalingProcessors LoopStartNotifier *loopstart.ObserversList Backoff backoff.Backoff DebuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter RemainingPdbTracker pdb.RemainingPdbTracker ScaleUpOrchestrator scaleup.Orchestrator DeleteOptions options.NodeDeleteOptions DrainabilityRules rules.Rules }
AutoscalerOptions is the whole set of options for configuring an autoscaler
type StaticAutoscaler ¶
type StaticAutoscaler struct { // AutoscalingContext consists of validated settings and options for this autoscaler *context.AutoscalingContext // contains filtered or unexported fields }
StaticAutoscaler is an autoscaler which has all the core functionality of a CA but without the reconfiguration feature
func NewStaticAutoscaler ¶
func NewStaticAutoscaler( opts config.AutoscalingOptions, fwHandle *framework.Handle, clusterSnapshot clustersnapshot.ClusterSnapshot, autoscalingKubeClients *context.AutoscalingKubeClients, processors *ca_processors.AutoscalingProcessors, loopStartNotifier *loopstart.ObserversList, cloudProvider cloudprovider.CloudProvider, expanderStrategy expander.Strategy, estimatorBuilder estimator.EstimatorBuilder, backoff backoff.Backoff, debuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter, remainingPdbTracker pdb.RemainingPdbTracker, scaleUpOrchestrator scaleup.Orchestrator, deleteOptions options.NodeDeleteOptions, drainabilityRules rules.Rules) *StaticAutoscaler
NewStaticAutoscaler creates an instance of Autoscaler filled with provided parameters
func (*StaticAutoscaler) ExitCleanUp ¶
func (a *StaticAutoscaler) ExitCleanUp()
ExitCleanUp performs all necessary clean-ups when the autoscaler's exiting.
func (*StaticAutoscaler) LastScaleDownDeleteTime ¶
func (a *StaticAutoscaler) LastScaleDownDeleteTime() time.Time
LastScaleDownDeleteTime returns the last successful scale down time
func (*StaticAutoscaler) LastScaleUpTime ¶
func (a *StaticAutoscaler) LastScaleUpTime() time.Time
LastScaleUpTime returns last scale up time
func (*StaticAutoscaler) RunOnce ¶
func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerError
RunOnce iterates over node groups and scales them up/down if necessary
func (*StaticAutoscaler) Start ¶
func (a *StaticAutoscaler) Start() error
Start starts components running in background.