From 0daa03a81f87088afe9f3e8eb9aa8341acd9c65b Mon Sep 17 00:00:00 2001 From: Chris O'Haver Date: Tue, 13 Mar 2018 03:06:03 -0400 Subject: exclude terminating pods (#1602) --- plugin/kubernetes/kubernetes.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/kubernetes/kubernetes.go b/plugin/kubernetes/kubernetes.go index 34dd47254..da1625c54 100644 --- a/plugin/kubernetes/kubernetes.go +++ b/plugin/kubernetes/kubernetes.go @@ -351,6 +351,11 @@ func (k *Kubernetes) findPods(r recordRequest, zone string) (pods []msg.Service, continue } + // exclude pods in the process of termination + if !p.ObjectMeta.DeletionTimestamp.IsZero() { + continue + } + // check for matching ip and namespace if ip == p.Status.PodIP && match(namespace, p.Namespace) { s := msg.Service{Key: strings.Join([]string{zonePath, Pod, namespace, podname}, "/"), Host: ip, TTL: k.ttl} -- cgit v1.2.3