zalando-incubator/cluster-lifecycle-manager

Include duration in logs when evicting pods

mikkeloscar opened this issue · 2 comments

Would be nice if the CLM logged for how long it had tried to evict each pod, to make it more clear which pods are not evictable for a long time.

I think it eventually logs how long it took to complete

localLogger.Infof("Pod evicted. (Observed termination period: %s)", time.Now().UTC().Sub(start))

which takes up to
gracePeriod := time.Duration(*pod.Spec.TerminationGracePeriodSeconds)*time.Second + podEvictionHeadroom

I am not sure it makes sense to log the retry progress as that may unnecessary pollute logs.

This is about force eviction (kubernetes delete -> grace period -> pod deletion), I think Mikkel meant the total time.