Hi @Shaked Klein Orbach ,
Thank you for posting your question.
The issue you are mentioning has been reported a while back, and is under works. Basically, Coredns pods are created with the annotation prometheus.io/port
but the annotation prometheus.io/scrape
is missing. That makes it hard to automatically scrape its metrics with an external Prometheus service.
To add the annotation to enable scraping, please run the below:
create a patcher file (coredns-patcher.yaml):
spec:
template:
metadata:
annotations:
prometheus.io/port: "9153"
prometheus.io/scrape: "true"
then
kubectl patch -n kube-system deploy coredns --patch "$(cat coredns-patcher.yaml)"
References:
AKS CoreDNS + Azure Prometheus - can't see metrics in log analytics
Missing prometheus.io/scrape annotation in coredns (this issue is still active)
Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.