# Node data not showing via node-exporter in Kubernetes

**URL:** <https://discuss.prometheus.io/t/node-data-not-showing-via-node-exporter-in-kubernetes/1503>\
**Category:** node\_exporter\
**Created:** [March 3, 2023, 1:30pm UTC](https://discuss.prometheus.io/t/node-data-not-showing-via-node-exporter-in-kubernetes/1503 "2023-03-03T13:30:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DiptimayeeBebarta](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@DiptimayeeBebarta](https://discuss.prometheus.io/u/DiptimayeeBebarta)\
**Post date:** [March 3, 2023, 1:30pm UTC](https://discuss.prometheus.io/t/node-data-not-showing-via-node-exporter-in-kubernetes/1503/1 "2023-03-03T13:30:07Z")

</div>

In Kubernetes cluster, when we installed node-exporter, it is returning the data of the nodes on which the prometheus pods are running but not of all other nodes.

---

<div class="post-metadata">

**Author:** ![stuart](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/stuart/32/18_2.png) [@stuart](https://discuss.prometheus.io/u/stuart)\
**Post date:** [March 3, 2023, 7:07pm UTC](https://discuss.prometheus.io/t/node-data-not-showing-via-node-exporter-in-kubernetes/1503/2 "2023-03-03T19:07:49Z")

</div>

How are you deploying node exporter? Within Kubernetes you’d generally use a daemonset to ensure it is running on every node.

---

<div class="post-metadata">

**Author:** ![DiptimayeeBebarta](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@DiptimayeeBebarta](https://discuss.prometheus.io/u/DiptimayeeBebarta)\
**Post date:** [March 4, 2023, 7:17am UTC](https://discuss.prometheus.io/t/node-data-not-showing-via-node-exporter-in-kubernetes/1503/3 "2023-03-04T07:17:20Z")

</div>

Yes we have deployed as daemonset, and each node-exporter pod is running on every node, but the nodes on which the prometheus pods are running only the data of those nodes are only coming.

---

<div class="post-metadata">

**Author:** ![stuart](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/stuart/32/18_2.png) [@stuart](https://discuss.prometheus.io/u/stuart)\
**Post date:** [March 4, 2023, 9:43am UTC](https://discuss.prometheus.io/t/node-data-not-showing-via-node-exporter-in-kubernetes/1503/4 "2023-03-04T09:43:33Z")

</div>

So you are only scraping some of the instances of node exporter?

That suggests your kubernetes\_sd setup for the node exporter isn’t correct. What is the full configuration for the node exporter job?

---

<div class="post-metadata">

**Author:** ![DiptimayeeBebarta](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@DiptimayeeBebarta](https://discuss.prometheus.io/u/DiptimayeeBebarta)\
**Post date:** [March 4, 2023, 11:54am UTC](https://discuss.prometheus.io/t/node-data-not-showing-via-node-exporter-in-kubernetes/1503/5 "2023-03-04T11:54:32Z")

</div>

No, we are scraping for all nodes, but when we try to query from grafana using promeetheus, it returns data for only those nodes on which prometheus pods are running. When we check the prometheus dahsboard we see the attached error.

 ![Screenshot 2023-03-03 at 11.15.48 AM](https://europe1.discourse-cdn.com/flex017/uploads/prometheus/original/1X/de98c1c4de2d8021bd0200b8f671a4be87cb36cd.png)

The job config for node-exporter :

- job\_name: ‘node-exporter’  
kubernetes\_sd\_configs:  
- role: node  
relabel\_configs:  
- source\_labels: [**address**]  
action: replace  
regex: ([^:]+):.\*  
replacement: $1:9100  
target\_label: **address**  
- source\_labels: [\_\_meta\_kubernetes\_node\_name]  
target\_label: name  
- source\_labels: [\_\_meta\_kubernetes\_node\_label\_beta\_kubernetes\_io\_arch]  
target\_label: arch  
- source\_labels: [\_\_meta\_kubernetes\_node\_label\_beta\_kubernetes\_io\_instance\_type]  
target\_label: instance\_type  
- source\_labels: [\_\_meta\_kubernetes\_node\_label\_kubernetes\_io\_os]  
target\_label: os  
- source\_labels: [\_\_meta\_kubernetes\_node\_label\_topology\_kubernetes\_io\_region]  
target\_label: region  
- source\_labels: [\_\_meta\_kubernetes\_node\_label\_topology\_kubernetes\_io\_zone]  
target\_label: zone  
- source\_labels: [\_\_meta\_kubernetes\_node\_label\_hostType]  
target\_label: hostType

---

<div class="post-metadata">

**Author:** ![stuart](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/stuart/32/18_2.png) [@stuart](https://discuss.prometheus.io/u/stuart)\
**Post date:** [March 4, 2023, 1:03pm UTC](https://discuss.prometheus.io/t/node-data-not-showing-via-node-exporter-in-kubernetes/1503/6 "2023-03-04T13:03:25Z")

</div>

Are you sure the node exporter is actually running on every node? What does `kubectl get pod -A | grep node` show?

If you exec into the Prometheus pod can you curl that URL yourself? Are there any errors? How long does it take to respond?

Do you have any sort of network policy in place, such as via a service mesh, overlay network or per-pod security groups?

---

<div class="post-metadata">

**Author:** ![DiptimayeeBebarta](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@DiptimayeeBebarta](https://discuss.prometheus.io/u/DiptimayeeBebarta)\
**Post date:** [March 7, 2023, 2:20pm UTC](https://discuss.prometheus.io/t/node-data-not-showing-via-node-exporter-in-kubernetes/1503/7 "2023-03-07T14:20:02Z")

</div>

Thanks for the quick reply. The issue was with the port opening in security groups.
