Monitoring CoreDNS communication in Kubernetes clusters

Every time a pod or service is created in a Kubernetes cluster, CoreDNS adds a record to its database. When Kubernetes services communicate with each other, they first make a DNS query to CoreDNS. CoreDNS resolves the request and returns a virtual IP. If CoreDNS malfunctions or has degraded performance, your microservices won't be able to communicate, leading to issues, including outages.

With the metrics plugin, CoreDNS provides the following Prometheus metrics on port 9153 to help debug potential issues:

  • coredns_panics_total: total number of panics
  • coredns_dns_requests_total: total query count
  • coredns_dns_request_duration_seconds: duration to process each query
  • coredns_dns_request_size_bytes: size of the request in bytes
  • coredns_dns_response_size_bytes: response size in bytes
  • coredns_dns_responses_total: response per zone, rcode and plugin

Monitor the impact of CoreDNS on system health

Because CoreDNS is a key part of communication between pods, you can use its metrics to see what's happening inside your cluster. A simple request rate metric like will show you how often CoreDNS is called, and you can use other metrics to analyze resolved requests.

The next visualization shows the total number of CoreDNS requests sorted by type. You can see that the majority of requests are A and AAAA requests.

Attachments

  • Original Link
  • Original Document
  • Permalink

Disclaimer

New Relic Inc. published this content on 26 April 2022 and is solely responsible for the information contained therein. Distributed by Public, unedited and unaltered, on 26 April 2022 17:01:09 UTC.