Interview Prep/Kubernetes/Services, Ingress and DNS

CoreDNS is slow and the cluster makes thousands of external lookups. How do you reduce the load?

AdvancedScenarioServices, Ingress and DNS
Answer

Situation read → Latency spikes and CoreDNS CPU is high, and many queries are for external names with long search-path expansions.

What I'd do →

  1. Lower ndots in pod dnsConfig to 2 for apps that call external hosts, or use trailing-dot FQDNs
  2. Deploy NodeLocal DNSCache as a DaemonSet
  3. Scale CoreDNS with the cluster-proportional-autoscaler
  4. Enable the cache plugin with a sensible TTL in the Corefile
  5. Watch coredns_dns_request_duration_seconds in Prometheus

Why → With ndots:5, an external name like api.stripe.com is tried against four search domains first, multiplying queries.

Interview tip → Also mention conntrack races on UDP DNS that NodeLocal DNSCache avoids.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Services, Ingress and DNS