diff --git a/cluster-autoscaler/core/scale_up.go b/cluster-autoscaler/core/scale_up.go index e9b184be9aa..ea8b92b1a8d 100644 --- a/cluster-autoscaler/core/scale_up.go +++ b/cluster-autoscaler/core/scale_up.go @@ -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,