Skip to content

Commit

Permalink
UPSTREAM: <carry>: fix calculation of max cluster size
Browse files Browse the repository at this point in the history
When scaling up, the calculation for the maximum size of the cluster
based on `--max-nodes-total` doesn't take into account any nodes that
are in the process of coming up. This allows the cluster to grow
beyond the size specified.

With this change I now see:

scale_up.go:266] 21 other pods are also unschedulable
scale_up.go:423] Best option to resize: openshift-cluster-api/amcdermo-ca-worker-us-east-2b
scale_up.go:427] Estimated 18 nodes needed in openshift-cluster-api/amcdermo-ca-worker-us-east-2b
scale_up.go:432] Capping size to max cluster total size (23)
static_autoscaler.go:275] Failed to scale up: max node total count already reached
  • Loading branch information
frobware committed Dec 18, 2018
1 parent 7477a4a commit 5bc77f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cluster-autoscaler/core/scale_up.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ func ScaleUp(context *context.AutoscalingContext, processors *ca_processors.Auto

if context.MaxNodesTotal > 0 && len(nodes)+newNodes > context.MaxNodesTotal {
klog.V(1).Infof("Capping size to max cluster total size (%d)", context.MaxNodesTotal)
newNodes = context.MaxNodesTotal - len(nodes)
newNodes = context.MaxNodesTotal - len(nodes) - len(upcomingNodes)
if newNodes < 1 {
return &status.ScaleUpStatus{Result: status.ScaleUpError}, errors.NewAutoscalerError(
errors.TransientError,
Expand Down

0 comments on commit 5bc77f0

Please sign in to comment.