From f70a2ab6d8e9128d79b01e3cf895d50d4ec2ab8b Mon Sep 17 00:00:00 2001 From: Avesh Agarwal Date: Tue, 15 Aug 2017 10:56:06 -0400 Subject: [PATCH] Update implementation of node usage calculation. --- pkg/rescheduler/strategies/lownodeutilization.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/rescheduler/strategies/lownodeutilization.go b/pkg/rescheduler/strategies/lownodeutilization.go index 8e235720d..9ade91254 100644 --- a/pkg/rescheduler/strategies/lownodeutilization.go +++ b/pkg/rescheduler/strategies/lownodeutilization.go @@ -196,11 +196,6 @@ func NodeUtilization(node *v1.Node, pods []*v1.Pod) (api.ResourceThresholds, []* totalReqs := map[v1.ResourceName]resource.Quantity{} for _, pod := range pods { - if podutil.IsBestEffortPod(pod) { - bePods = append(bePods, pod) - continue - } - sr, err := podutil.CreatorRef(pod) if err != nil { sr = nil @@ -208,7 +203,14 @@ func NodeUtilization(node *v1.Node, pods []*v1.Pod) (api.ResourceThresholds, []* if podutil.IsMirrorPod(pod) || podutil.IsPodWithLocalStorage(pod) || sr == nil || podutil.IsDaemonsetPod(sr) { nonRemovablePods = append(nonRemovablePods, pod) + if podutil.IsBestEffortPod(pod) { + continue + } + } else if podutil.IsBestEffortPod(pod) { + bePods = append(bePods, pod) + continue } else { + // todo: differentiate between burstable and guranteed pods otherPods = append(otherPods, pod) }