Kubernetes plugin cache is not deleting "succeeded" pods
Author: dannycheung-roktCreated Jun 19, 2023Updated Sep 30, 2026
Labelsbug
What happened:
- In NamespaceA, PodA is spawned.
kubernetesplugin sees the pod and caches the IP.- PodA completes and has a phase of "Succeeded". The IP is released back to k8s.
- In NamespaceB, PodB is spawned. It is assigned the IP previously held by PodA.
- CoreDNS logs show the
kubernetes/client-namespacemetadata is NamespaceA
What you expected to happen:
CoreDNS logs show the kubernetes/client-namespace metadata is NamespaceB
How to reproduce it (as minimally and precisely as possible):
Difficult to reliably recreate as it requires IP addresses to re-assigned/re-used.
Anything else we need to know?:
Environment:
- the version of CoreDNS: v1.8.7
- Corefile:
.:53 {
errors
health
metadata
log . "{remote}:{port} - {>id} \"{type} {class} {name} {proto} {size} {>do} {>bufsize}\" {rcode} {>rflags} {rsize} {duration} {/kubernetes/client-namespace} {/kubernetes/client-pod-name} {/kubernetes/parse-error}"
autopath @kubernetes
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods verified
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
forward . /etc/resolv.conf
cache 30
loop
reload
loadbalance
template ANY AAAA {
rcode NOERROR
}
}- logs, if applicable:
- OS (e.g:
cat /etc/os-release): - Others:
Source: coredns/coredns