I'm trying to scrape pods in my kubernetes cluster. I have deployed prometheus with helm install prometheus stable/prometheus -n monitoring
command to set it in the monitoring namespace.
I'm trying to apply recommanded instructions to scrape pods by adding annotations inside pods elements :
kubectl edit pod nfs-provisioner-nfs-client-provisioner-648b66fc7c-w2btj -n storage
adding :
metadata:
annotations:
prometheus.io/path: /metrics
prometheus.io/port: "8080"
prometheus.io/scrape: "true"
as mentionned in this link: https://hub.helm.sh/charts/stable/prometheus
but for whatever reason I cannot figure out to solve, I get a connection refused in prometheus target dashboard
STATE DOWN and Get http://10.233.96.18:8080/metrics: dial tcp 10.233.96.18:8080: connect: connection refused
as error :
what am I doing wrong ?