From 333b5cfbb6a490f1d943e2c7d03cd3e236dbedbc Mon Sep 17 00:00:00 2001 From: Amir Alavi Date: Fri, 16 Jun 2023 02:30:19 -0400 Subject: [PATCH] bump log level for processing info --- pkg/framework/plugins/podlifetime/pod_lifetime.go | 2 +- pkg/framework/plugins/removeduplicates/removeduplicates.go | 2 +- pkg/framework/plugins/removefailedpods/failedpods.go | 2 +- .../removepodshavingtoomanyrestarts/toomanyrestarts.go | 2 +- .../pod_antiaffinity.go | 2 +- .../plugins/removepodsviolatingnodeaffinity/node_affinity.go | 2 +- .../topologyspreadconstraint.go | 4 +++- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pkg/framework/plugins/podlifetime/pod_lifetime.go b/pkg/framework/plugins/podlifetime/pod_lifetime.go index b6e327789..0285057c3 100644 --- a/pkg/framework/plugins/podlifetime/pod_lifetime.go +++ b/pkg/framework/plugins/podlifetime/pod_lifetime.go @@ -106,7 +106,7 @@ func (d *PodLifeTime) Deschedule(ctx context.Context, nodes []*v1.Node) *framewo nodeMap := make(map[string]*v1.Node, len(nodes)) for _, node := range nodes { - klog.V(1).InfoS("Processing node", "node", klog.KObj(node)) + klog.V(2).InfoS("Processing node", "node", klog.KObj(node)) pods, err := podutil.ListAllPodsOnANode(node.Name, d.handle.GetPodsAssignedToNodeFunc(), d.podFilter) if err != nil { // no pods evicted as error encountered retrieving evictable Pods diff --git a/pkg/framework/plugins/removeduplicates/removeduplicates.go b/pkg/framework/plugins/removeduplicates/removeduplicates.go index 4e310c3bf..3d83f3b62 100644 --- a/pkg/framework/plugins/removeduplicates/removeduplicates.go +++ b/pkg/framework/plugins/removeduplicates/removeduplicates.go @@ -100,7 +100,7 @@ func (r *RemoveDuplicates) Balance(ctx context.Context, nodes []*v1.Node) *frame nodeMap := make(map[string]*v1.Node) for _, node := range nodes { - klog.V(1).InfoS("Processing node", "node", klog.KObj(node)) + klog.V(2).InfoS("Processing node", "node", klog.KObj(node)) pods, err := podutil.ListPodsOnANode(node.Name, r.handle.GetPodsAssignedToNodeFunc(), r.podFilter) if err != nil { klog.ErrorS(err, "Error listing evictable pods on node", "node", klog.KObj(node)) diff --git a/pkg/framework/plugins/removefailedpods/failedpods.go b/pkg/framework/plugins/removefailedpods/failedpods.go index f77d0b629..fbc85ff62 100644 --- a/pkg/framework/plugins/removefailedpods/failedpods.go +++ b/pkg/framework/plugins/removefailedpods/failedpods.go @@ -93,7 +93,7 @@ func (d *RemoveFailedPods) Name() string { // Deschedule extension point implementation for the plugin func (d *RemoveFailedPods) Deschedule(ctx context.Context, nodes []*v1.Node) *frameworktypes.Status { for _, node := range nodes { - klog.V(1).InfoS("Processing node", "node", klog.KObj(node)) + klog.V(2).InfoS("Processing node", "node", klog.KObj(node)) pods, err := podutil.ListAllPodsOnANode(node.Name, d.handle.GetPodsAssignedToNodeFunc(), d.podFilter) if err != nil { // no pods evicted as error encountered retrieving evictable Pods diff --git a/pkg/framework/plugins/removepodshavingtoomanyrestarts/toomanyrestarts.go b/pkg/framework/plugins/removepodshavingtoomanyrestarts/toomanyrestarts.go index 4db4c16ab..835422b38 100644 --- a/pkg/framework/plugins/removepodshavingtoomanyrestarts/toomanyrestarts.go +++ b/pkg/framework/plugins/removepodshavingtoomanyrestarts/toomanyrestarts.go @@ -107,7 +107,7 @@ func (d *RemovePodsHavingTooManyRestarts) Name() string { // Deschedule extension point implementation for the plugin func (d *RemovePodsHavingTooManyRestarts) Deschedule(ctx context.Context, nodes []*v1.Node) *frameworktypes.Status { for _, node := range nodes { - klog.V(1).InfoS("Processing node", "node", klog.KObj(node)) + klog.V(2).InfoS("Processing node", "node", klog.KObj(node)) pods, err := podutil.ListAllPodsOnANode(node.Name, d.handle.GetPodsAssignedToNodeFunc(), d.podFilter) if err != nil { // no pods evicted as error encountered retrieving evictable Pods diff --git a/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity.go b/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity.go index f5dc8e2c6..0e66d69ba 100644 --- a/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity.go +++ b/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity.go @@ -91,7 +91,7 @@ func (d *RemovePodsViolatingInterPodAntiAffinity) Deschedule(ctx context.Context loop: for _, node := range nodes { - klog.V(1).InfoS("Processing node", "node", klog.KObj(node)) + klog.V(2).InfoS("Processing node", "node", klog.KObj(node)) pods := podsOnANode[node.Name] // sort the evict-able Pods based on priority, if there are multiple pods with same priority, they are sorted based on QoS tiers. podutil.SortPodsBasedOnPriorityLowToHigh(pods) diff --git a/pkg/framework/plugins/removepodsviolatingnodeaffinity/node_affinity.go b/pkg/framework/plugins/removepodsviolatingnodeaffinity/node_affinity.go index e6f820b71..f2fadbb39 100644 --- a/pkg/framework/plugins/removepodsviolatingnodeaffinity/node_affinity.go +++ b/pkg/framework/plugins/removepodsviolatingnodeaffinity/node_affinity.go @@ -82,7 +82,7 @@ func (d *RemovePodsViolatingNodeAffinity) Deschedule(ctx context.Context, nodes switch nodeAffinity { case "requiredDuringSchedulingIgnoredDuringExecution": for _, node := range nodes { - klog.V(1).InfoS("Processing node", "node", klog.KObj(node)) + klog.V(2).InfoS("Processing node", "node", klog.KObj(node)) pods, err := podutil.ListPodsOnANode( node.Name, diff --git a/pkg/framework/plugins/removepodsviolatingtopologyspreadconstraint/topologyspreadconstraint.go b/pkg/framework/plugins/removepodsviolatingtopologyspreadconstraint/topologyspreadconstraint.go index eeb049b50..be4be61b2 100644 --- a/pkg/framework/plugins/removepodsviolatingtopologyspreadconstraint/topologyspreadconstraint.go +++ b/pkg/framework/plugins/removepodsviolatingtopologyspreadconstraint/topologyspreadconstraint.go @@ -102,7 +102,7 @@ func (d *RemovePodsViolatingTopologySpreadConstraint) Balance(ctx context.Contex // iterate through all topoPairs for this topologyKey and diff currentPods -minPods <=maxSkew // if diff > maxSkew, add this pod in the current bucket for eviction - klog.V(1).InfoS("Processing namespaces for topology spread constraints") + klog.V(1).Info("Processing namespaces for topology spread constraints") podsForEviction := make(map[*v1.Pod]struct{}) var includedNamespaces, excludedNamespaces sets.Set[string] if d.args.Namespaces != nil { @@ -121,6 +121,8 @@ func (d *RemovePodsViolatingTopologySpreadConstraint) Balance(ctx context.Contex // 1. for each namespace... for namespace := range namespacedPods { + klog.V(4).InfoS("Processing namespace for topology spread constraints", "namespace", namespace) + if (len(includedNamespaces) > 0 && !includedNamespaces.Has(namespace)) || (len(excludedNamespaces) > 0 && excludedNamespaces.Has(namespace)) { continue