coredns: Intermittent DNS Resolution Failures with CoreDNS v1.11.3 in Kubernetes Cluster - Resolved Temporarily by Pod Restarts

I’m experiencing intermittent DNS resolution failures in some pods within a Kubernetes cluster using CoreDNS version v1.11.3 (image: registry.k8s.io/coredns/coredns:v1.11.3). The issue is temporarily resolved by restarting the affected pods, but it reoccurs over time. I’m seeking assistance to diagnose and permanently resolve this problem.

Environment:

CoreDNS Version: v1.11.3 (image: registry.k8s.io/coredns/coredns:v1.11.3) Kubernetes Version: Server Version: v1.32.1 Cluster Environment: BareMetal Server (IO Flood) Operating System: Ubuntu 24.04.2 LTS Kernel Version: 6.8.0-54-generic Number of CoreDNS Replicas: 2

CoreDNS ConfigMap:

Here’s the current CoreDNS ConfigMap configuration deployed in the kube-system namespace: text

.:53 {
    errors
    health {
       lameduck 5s
    }
    ready
    kubernetes cluster.local in-addr.arpa ip6.arpa {
       pods insecure
       fallthrough in-addr.arpa ip6.arpa
       ttl 30
    }
    prometheus :9153
    forward . /etc/resolv.conf {
       max_concurrent 1000
    }
    cache 30 {
       disable success cluster.local
       disable denial cluster.local
    }
    loop
    reload
    loadbalance
}

Problem Description:

Symptoms: Some pods in the cluster intermittently fail to resolve DNS queries (both internal, e.g., kubernetes.default.svc.cluster.local). The failures are not consistent across all pods or all times.

Temporary Fix: Restarting the affected pods (kubectl delete pod <pod-name>) resolves the issue temporarily, but it reappears after some time.

Impact: Applications relying on DNS resolution experience intermittent connectivity issues, disrupting normal operation.

Could you help identify potential causes of these intermittent DNS failures based on the provided configuration and symptoms?

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Kubernetes’ recommended mitigation for this is to deploy node local DNS cache.

Thank you, very interesting! I already read this doc, but I’m not sure I understand how is different by just updating CoreDNS deployment to run pod on every node?

Simply running CoreDNS on every node would not mean that each CoreDNS handles traffic originating from its node. DNS traffic would still get routed to a random CoreDNS, over UDP, and thus still be subject to the intermittent packet drop issue. Also deploying CoreDNS to each node would put excess strain on the k8s api, since each of them would be maintaining a watch on services and endpoints.

If we’re speaking about a kernel bug, why this bug doesn’t affect all traffic, but just DNS?

It does. But most services communicate over TCP which is much more robust to intermittent packet drops than UDP is.

Node local dns instances accept UDP DNS requests from local Pods, and forward cluster domain queries over TCP to the CoreDNS service (for external queries it sends the upstream directly, also bypassing the bug).