Skip to content

Commit 49ce70a

Browse files
enxebreelmiko
authored andcommitted
report MaxNodesTotal count during scale up
This change adds a warning event to signal when a planned scale up operation would go over the maximum total nodes. This is being proposed for two primary reasons: as an event that can be watched during end-to-end testing, and as a signal to users when this condition is occurring.
1 parent 7b7d704 commit 49ce70a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cluster-autoscaler/core/scale_up.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ func ScaleUp(context *context.AutoscalingContext, processors *ca_processors.Auto
464464
if context.MaxNodesTotal > 0 && len(nodes)+newNodes+len(upcomingNodes) > context.MaxNodesTotal {
465465
klog.V(1).Infof("Capping size to max cluster total size (%d)", context.MaxNodesTotal)
466466
newNodes = context.MaxNodesTotal - len(nodes) - len(upcomingNodes)
467+
context.LogRecorder.Eventf(apiv1.EventTypeWarning, "MaxNodesTotalReached", "Max total nodes in cluster reached: %v", context.MaxNodesTotal)
467468
if newNodes < 1 {
468469
return &status.ScaleUpStatus{Result: status.ScaleUpError}, errors.NewAutoscalerError(
469470
errors.TransientError,

0 commit comments

Comments
 (0)