Skip to content

Commit 48e5097

Browse files
author
Maksim Fedotov
committed
[clusterapi] Do not skip nodegroups with minSize=maxSize
1 parent 601da3f commit 48e5097

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cluster-autoscaler/cloudprovider/clusterapi/clusterapi_nodegroup.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package clusterapi
1818

1919
import (
2020
"fmt"
21+
"k8s.io/klog/v2"
2122
"math/rand"
2223

2324
"github.com/pkg/errors"
@@ -355,7 +356,12 @@ func newNodeGroupFromScalableResource(controller *machineController, unstructure
355356
}
356357

357358
// Ensure the node group would have the capacity to scale
358-
if scalableResource.MaxSize()-scalableResource.MinSize() < 1 {
359+
// allow MinSize = 0
360+
// allow MaxSize = MinSize
361+
// don't allow MaxSize < MinSize
362+
// don't allow MaxSize = MinSize = 0
363+
if scalableResource.MaxSize()-scalableResource.MinSize() < 0 || scalableResource.MaxSize() == 0 {
364+
klog.V(4).Infof("nodegroup %s has no scaling capacity, skipping", scalableResource.Name())
359365
return nil, nil
360366
}
361367

0 commit comments

Comments
 (0)