Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.

Commit 4192c7c

Browse files
authored
Merge pull request #1184 from mwielgus/more-debug-3
Cluster-autoscaler: more debugs around scale down
2 parents 3a537f9 + 09d5210 commit 4192c7c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

cluster-autoscaler/cluster_autoscaler.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ func main() {
174174
newUnschedulablePodsToHelp := FilterOutSchedulable(unschedulablePodsToHelp, nodes, allScheduled, predicateChecker)
175175

176176
if len(newUnschedulablePodsToHelp) != len(unschedulablePodsToHelp) {
177+
glog.V(2).Info("Schedulable pods present")
177178
schedulablePodsPresent = true
178179
}
179180
unschedulablePodsToHelp = newUnschedulablePodsToHelp
@@ -208,7 +209,12 @@ func main() {
208209
lastScaleDownFailedTrial.Add(*scaleDownTrialInterval).After(time.Now()) ||
209210
schedulablePodsPresent
210211

212+
glog.V(4).Info("Scale down status: unneededOnly=%v lastScaleUpTime=%s "+
213+
"lastScaleDownFailedTrail=%s schedulablePodsPresent=%v", calculateUnneededOnly,
214+
lastScaleUpTime, lastScaleDownFailedTrial, schedulablePodsPresent)
215+
211216
updateLastTime("findUnneeded")
217+
glog.V(4).Infof("Calculating unneded nodes")
212218

213219
unneededNodes = FindUnneededNodes(
214220
nodes,
@@ -219,7 +225,15 @@ func main() {
219225

220226
updateDuration("findUnneeded", unneededStart)
221227

228+
for key, val := range unneededNodes {
229+
if glog.V(4) {
230+
glog.V(4).Infof("%s is unneeded since %s duration %s", key, val.String(), time.Now().Sub(val).String())
231+
}
232+
}
233+
222234
if !calculateUnneededOnly {
235+
glog.V(4).Infof("Starting scale down")
236+
223237
scaleDownStart := time.Now()
224238
updateLastTime("scaledown")
225239

cluster-autoscaler/scale_down.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func ScaleDown(
115115
for _, node := range nodes {
116116
if val, found := unneededNodes[node.Name]; found {
117117

118-
glog.V(2).Infof("%s was underutilized for %s", node.Name, now.Sub(val).String())
118+
glog.V(2).Infof("%s was unneeded for %s", node.Name, now.Sub(val).String())
119119

120120
// Check how long the node was underutilized.
121121
if !val.Add(unneededTime).Before(now) {

0 commit comments

Comments
 (0)