Why does DNS resolution fail when CoreDNS pods are restarted?
Virtual Private Cloud Classic infrastructure
Your app sometimes fails to resolve DNS names for cluster services around the same time that one or more CoreDNS pods are restarted, such as during a worker reload or patch update.
Your app's DNS request was sent to a CoreDNS pod that was in the process of terminating.
To help the CoreDNS pods terminate without disruption, you can edit the coredns
configmap in the kube-system
namespace.
In the health
plug-in configuration of the main Corefile, add lameduck 10s
. For more information on customizing CoreDNS, see Customizing the cluster DNS provider.
The resulting customization looks like the following example.
health {
lameduck 10s
}