Hi,
I have K8 cluster and deployed Prometheus in a pod (as a service) and node exporters (as daemon set) and they are all in same namespace. node_exporters are deployed with
"annotations": {
"prometheus.io.scrape": "true"
}
However, Prometheus is not showing any node exporters in the target list even with its config looking for these labels. I found this config in a blog:
# scrape from node_exporter running on all nodes
- job_name: 'node-exporters'
kubernetes_sd_configs:
- role: pod
api_server: '
https://10.0.0.1:8080' <=== tried kuberetes.default.svc.cluster.local (IP, DNS names with and without port#s 443, 6443, 8080 but none of this worked)
tls_config:
insecure_skip_verify: true
# You can specify the following annotations (on pods):
# prometheus.io.scrape: true - scrape this pod
# prometheus.io.port - scrape this port
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
action: keep
regex: true
- source_labels: [__meta_kubernetes_pod_namespace, __meta_kubernetes_pod_label_name]
separator: '/'
target_label: job
- source_labels: [__meta_kubernetes_pod_node_name]
target_label: node
Is there anything wrong with the config ? Can someone please help ? I can provide more information. Prometheus version is 1.4.1. and K8 version is 1.5.1.
Thanks,
SK