From c262bdcf0abbcf3528a964f6f4507bbf5f23a979 Mon Sep 17 00:00:00 2001 From: Oilbeater Date: Mon, 28 Mar 2022 18:41:35 +0800 Subject: [PATCH] fix: do not recreate port for terminating pods (#1409) When node is not ready lots of pods may stay in `Terminating` status. The inspection previously will always put the pods into addQueue which will waste lots of cpu. (cherry picked from commit a378fad2469da2916d254227bf9a0e682bcbb78f) --- pkg/controller/inspection.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/controller/inspection.go b/pkg/controller/inspection.go index 04bcd684d7e..cf3db332757 100644 --- a/pkg/controller/inspection.go +++ b/pkg/controller/inspection.go @@ -30,6 +30,11 @@ func (c *Controller) inspectPod() error { if pod.Spec.HostNetwork { continue } + + if !isPodAlive(pod) { + continue + } + podName := c.getNameByPod(pod) podNets, err := c.getPodKubeovnNets(pod) if err != nil {