Scraping kube-dns for Metrics Kubernetes and Prometheus


I had installed Prometheus via the Helm Chart. Most everything worked great out of the box, but it failed to scrape /metrics on the kube-dns pods.


By default, the Prometheus Helm Chart will scrape kube-dns pods on port 53. Adding annotations, telling Prometheus to scrape and the port number, corrects this issue.


Locate the service object for kube-dns. Add these two annotations inside of the metadata section:

"annotations": {
  "": "9153",
  "": "true"

© 2021. All rights reserved.