DNS lookups inside the cluster intermittently take 5 seconds. How do you monitor and catch this?
AdvancedScenarioGrafana, Dashboards and Kubernetes Monitoring
Answer
Situation read → Classic conntrack race or CoreDNS overload, often with ndots:5 causing many lookups.
What I'd do →
- Monitor CoreDNS:
coredns_dns_request_duration_seconds,coredns_dns_responses_total{rcode="SERVFAIL"},coredns_forward_requests_total. - Add a blackbox DNS probe from inside the cluster.
- Deploy NodeLocal DNSCache to reduce conntrack races and load.
- Lower
ndotsin poddnsConfigor use FQDNs with trailing dots for external names. - Scale CoreDNS (HPA or proportional autoscaler).
Why → 5-second delays match the default resolver timeout after a dropped UDP packet.
Interview tip → Mentioning the 5s timeout and NodeLocal DNSCache shows real experience.
More on Grafana, Dashboards and Kubernetes Monitoring
Grafana has 900 dashboards and nobody can find anything. How do you clean it up?IntermediateHow do you manage Grafana dashboards as code?IntermediateDesign a service overview dashboard that an on-call engineer can read in 10 seconds.BeginnerYou need to show deploy events on every Grafana graph. How?BeginnerPods are being OOMKilled but the memory graph never reaches the limit. Why?IntermediateHow do you detect CPU throttling hurting latency in Kubernetes?Intermediate