@@ -20,6 +20,7 @@ import (
2020	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider" 
2121	"k8s.io/autoscaler/cluster-autoscaler/context" 
2222	"k8s.io/autoscaler/cluster-autoscaler/simulator" 
23+ 	"k8s.io/autoscaler/cluster-autoscaler/utils/klogx" 
2324	klog "k8s.io/klog/v2" 
2425)
2526
@@ -83,6 +84,8 @@ type AtomicResizeFilteringProcessor struct {
8384
8485// GetNodesToRemove selects up to maxCount nodes for deletion, by selecting a first maxCount candidates 
8586func  (p  * AtomicResizeFilteringProcessor ) GetNodesToRemove (ctx  * context.AutoscalingContext , candidates  []simulator.NodeToBeRemoved , maxCount  int ) []simulator.NodeToBeRemoved  {
87+ 	atomicQuota  :=  klogx .NodesLoggingQuota ()
88+ 	standardQuota  :=  klogx .NodesLoggingQuota ()
8689	nodesByGroup  :=  map [cloudprovider.NodeGroup ][]simulator.NodeToBeRemoved {}
8790	result  :=  []simulator.NodeToBeRemoved {}
8891	for  _ , node  :=  range  candidates  {
@@ -97,13 +100,15 @@ func (p *AtomicResizeFilteringProcessor) GetNodesToRemove(ctx *context.Autoscali
97100			continue 
98101		}
99102		if  autoscalingOptions  !=  nil  &&  autoscalingOptions .ZeroOrMaxNodeScaling  {
100- 			klog .V (2 ).Infof ("Considering node %s for atomic scale down" , node .Node .Name )
103+ 			klogx .V (2 ). UpTo ( atomicQuota ).Infof ("Considering node %s for atomic scale down" , node .Node .Name )
101104			nodesByGroup [nodeGroup ] =  append (nodesByGroup [nodeGroup ], node )
102105		} else  {
103- 			klog .V (2 ).Infof ("Considering node %s for standard scale down" , node .Node .Name )
106+ 			klogx .V (2 ). UpTo ( standardQuota ).Infof ("Considering node %s for standard scale down" , node .Node .Name )
104107			result  =  append (result , node )
105108		}
106109	}
110+ 	klogx .V (2 ).Over (atomicQuota ).Infof ("Considering %d other nodes for atomic scale down" , - atomicQuota .Left ())
111+ 	klogx .V (2 ).Over (standardQuota ).Infof ("Considering %d other nodes for standard scale down" , - atomicQuota .Left ())
107112	for  nodeGroup , nodes  :=  range  nodesByGroup  {
108113		ngSize , err  :=  nodeGroup .TargetSize ()
109114		if  err  !=  nil  {
0 commit comments