Cluster-autoscaler: skip scale down if schedulable but not scheduled pods are present

This commit is contained in:
Marcin Wielgus 2016-05-25 17:47:12 +02:00
parent 910e04addd
commit 956e20c33f
1 changed files with 9 additions and 2 deletions

View File

@ -143,8 +143,14 @@ func main() {
//
// Without below check cluster might be unnecessary scaled up to the max allowed size
// in the describe situation.
schedulablePodsPresent := false
if *verifyUnschedulablePods {
unschedulablePodsToHelp = FilterOutSchedulable(unschedulablePodsToHelp, nodes, allScheduled, predicateChecker)
newUnschedulablePodsToHelp := FilterOutSchedulable(unschedulablePodsToHelp, nodes, allScheduled, predicateChecker)
if len(newUnschedulablePodsToHelp) != len(unschedulablePodsToHelp) {
schedulablePodsPresent = true
}
unschedulablePodsToHelp = newUnschedulablePodsToHelp
}
if len(unschedulablePodsToHelp) == 0 {
@ -166,7 +172,8 @@ func main() {
if *scaleDownEnabled {
// In dry run only utilization is updated
calculateUtilizationOnly := lastScaleUpTime.Add(*scaleDownDelay).After(time.Now()) ||
lastScaleDownFailedTrial.Add(*scaleDownTrialFrequency).After(time.Now())
lastScaleDownFailedTrial.Add(*scaleDownTrialFrequency).After(time.Now()) ||
schedulablePodsPresent
underutilizedNodes = CalculateUnderutilizedNodes(
nodes,