Merge branch 'kubernetes:master' into feature/runtime-limits
This commit is contained in:
commit
363fd1638a
|
|
@ -621,23 +621,27 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerErr
|
|||
a.processorCallbacks.disableScaleDownForLoop, scaleDownInCooldown)
|
||||
metrics.UpdateScaleDownInCooldown(scaleDownInCooldown)
|
||||
|
||||
// We want to delete unneeded Node Groups only if here is no current delete
|
||||
// in progress.
|
||||
_, drained := scaleDownActuationStatus.DeletionsInProgress()
|
||||
var removedNodeGroups []cloudprovider.NodeGroup
|
||||
if len(drained) == 0 {
|
||||
var err error
|
||||
removedNodeGroups, err = a.processors.NodeGroupManager.RemoveUnneededNodeGroups(autoscalingContext)
|
||||
if err != nil {
|
||||
klog.Errorf("Error while removing unneeded node groups: %v", err)
|
||||
}
|
||||
scaleDownStatus.RemovedNodeGroups = removedNodeGroups
|
||||
}
|
||||
|
||||
if scaleDownInCooldown {
|
||||
scaleDownStatus.Result = scaledownstatus.ScaleDownInCooldown
|
||||
if len(removedNodeGroups) > 0 {
|
||||
a.processors.ScaleDownStatusProcessor.Process(autoscalingContext, scaleDownStatus)
|
||||
}
|
||||
} else {
|
||||
klog.V(4).Infof("Starting scale down")
|
||||
|
||||
// We want to delete unneeded Node Groups only if there was no recent scale up,
|
||||
// and there is no current delete in progress and there was no recent errors.
|
||||
_, drained := scaleDownActuationStatus.DeletionsInProgress()
|
||||
var removedNodeGroups []cloudprovider.NodeGroup
|
||||
if len(drained) == 0 {
|
||||
var err error
|
||||
removedNodeGroups, err = a.processors.NodeGroupManager.RemoveUnneededNodeGroups(autoscalingContext)
|
||||
if err != nil {
|
||||
klog.Errorf("Error while removing unneeded node groups: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
scaleDownStart := time.Now()
|
||||
metrics.UpdateLastTime(metrics.ScaleDown, scaleDownStart)
|
||||
empty, needDrain := a.scaleDownPlanner.NodesToDelete(currentTime)
|
||||
|
|
|
|||
Loading…
Reference in New Issue