Skip to content

Commit

Permalink
Merge pull request #4104 from brett-elliott/stopcooldown
Browse files Browse the repository at this point in the history
Don't start CA in cooldown mode.
  • Loading branch information
k8s-ci-robot authored May 27, 2021
2 parents 10dfcae + 1880fe6 commit 0298597
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cluster-autoscaler/core/static_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,15 @@ func NewStaticAutoscaler(

scaleDown := NewScaleDown(autoscalingContext, processors, clusterStateRegistry)

// Set the initial scale times to be less than the start time so as to
// not start in cooldown mode.
initialScaleTime := time.Now().Add(-time.Hour)
return &StaticAutoscaler{
AutoscalingContext: autoscalingContext,
startTime: time.Now(),
lastScaleUpTime: time.Now(),
lastScaleDownDeleteTime: time.Now(),
lastScaleDownFailTime: time.Now(),
lastScaleUpTime: initialScaleTime,
lastScaleDownDeleteTime: initialScaleTime,
lastScaleDownFailTime: initialScaleTime,
scaleDown: scaleDown,
processors: processors,
processorCallbacks: processorCallbacks,
Expand Down

0 comments on commit 0298597

Please sign in to comment.