# Issue with kubernetes metric data fetch by meteicbeat

**URL:** <https://discuss.elastic.co/t/issue-with-kubernetes-metric-data-fetch-by-meteicbeat/371404>\
**Category:** Elastic Search\
**Created:** [December 3, 2024, 5:30pm UTC](https://discuss.elastic.co/t/issue-with-kubernetes-metric-data-fetch-by-meteicbeat/371404 "2024-12-03T17:30:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam96](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Sam96](https://discuss.elastic.co/u/Sam96)\
**Post date:** [December 3, 2024, 5:30pm UTC](https://discuss.elastic.co/t/issue-with-kubernetes-metric-data-fetch-by-meteicbeat/371404/1 "2024-12-03T17:30:59Z")

</div>

I have installed the Elasticsearch(8.16) and kibana(8.16) using RPMs in Centos vm.Also installed Metricbeats (8.16) in the centos vm using RPMS.

In the same vm i have kubernetes cluster and our application is running in the k3s cluster.I am trying to capture the kubernetes metrics and see that in Kibana dashboard.

Issue :  
I am able to see the namesapce details in the dashboard but the pod, deployment fields i am getting as no data found. like this attached screenshot.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/b/1b1d3e50096bd5357527b2e08072d3e33ad1aa30.png)

this is the content of the In the

/etc/metricbeat/modules.d/kubernetes.yml

# Node metrics, from kubelet:

- module: kubernetes  
metricsets:
  - node
  - pod
  - system
  - volume  
period: 10s  
enabled: true  
_**hosts: ["[https://127.0.0.1:6443](https://127.0.0.1:6443)"]**_\*\*  
bearer\_token\_file: /var/lib/metricbeat/kubernetes-app-token (This is the self signed token )  
ssl.verification\_mode: "none"  
ssl.certificate\_authorities: ["/var/lib/rancher/k3s/server/tls/client-ca.crt"]  
ssl.certificate: "/var/lib/rancher/k3s/server/tls/client-kube-apiserver.crt"  
ssl.key: "/var/lib/rancher/k3s/server/tls/client-kube-apiserver.key"  
add\_metadata: true  
kubeconfig: "/etc/rancher/k3s/k3s.yaml"  
node: node2  
namespace: default

Below is the error message i am getting in the logs of Metricbeat :

{"log.level":"error","@timestamp":"2024-12-03T11:11:26.621Z","log.logger":"kubernetes.node","log.origin":{"function":"[github.com/elastic/beats/v7/metricbeat/module/kubernetes/node.(\*MetricSet).Fetch","file.name":"node/node.go","file.line":91},"message":"HTTP](http://github.com/elastic/beats/v7/metricbeat/module/kubernetes/node.(*MetricSet).Fetch%22,%22file.name%22:%22node/node.go%22,%22file.line%22:91%7D,%22message%22:%22HTTP) error 404 in : 404 Not Found","service.name":"metricbeat","ecs.version":"1.6.0"}

{"log.level":"error","@timestamp":"2024-12-03T11:11:26.621Z","log.origin":{"function":"[github.com/elastic/beats/v7/metricbeat/mb/module.(\*metricSetWrapper).fetch","file.name":"module/wrapper.go","file.line":266},"message":"Error](http://github.com/elastic/beats/v7/metricbeat/mb/module.(*metricSetWrapper).fetch%22,%22file.name%22:%22module/wrapper.go%22,%22file.line%22:266%7D,%22message%22:%22Error) fetching data for metricset kubernetes.system: error doing HTTP request to fetch 'system' Metricset data: HTTP error 404 in : 404 Not Found","service.name":"metricbeat","ecs.version":"1.6.0"}

{"log.level":"error","@timestamp":"2024-12-03T11:11:26.621Z","log.logger":"kubernetes.pod","log.origin":{"function":"[github.com/elastic/beats/v7/metricbeat/module/kubernetes/pod.(\*MetricSet).Fetch","file.name":"pod/pod.go","file.line":92},"message":"HTTP](http://github.com/elastic/beats/v7/metricbeat/module/kubernetes/pod.(*MetricSet).Fetch%22,%22file.name%22:%22pod/pod.go%22,%22file.line%22:92%7D,%22message%22:%22HTTP) error 404 in : 404 Not Found","service.name":"metricbeat","ecs.version":"1.6.0"}

{"log.level":"error","@timestamp":"2024-12-03T11:11:26.621Z","log.origin":{"function":"[github.com/elastic/beats/v7/metricbeat/mb/module.(\*metricSetWrapper).fetch","file.name":"module/wrapper.go","file.line":266},"message":"Error](http://github.com/elastic/beats/v7/metricbeat/mb/module.(*metricSetWrapper).fetch%22,%22file.name%22:%22module/wrapper.go%22,%22file.line%22:266%7D,%22message%22:%22Error) fetching data for metricset kubernetes.volume: error doing HTTP request to fetch 'volume' Metricset data: HTTP error 404 in : 404 Not Found","service.name":"metricbeat","ecs.version":"1.6.0"}

Note : The Metricbeats is installed as RPM and not inside kubernetes cluster.But both are in same vm.

Please guide us fixing this issue , Thanks in advance.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 3, 2024, 6:40pm UTC](https://discuss.elastic.co/t/issue-with-kubernetes-metric-data-fetch-by-meteicbeat/371404/2 "2024-12-03T18:40:53Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 3, 2024, 7:42pm UTC](https://discuss.elastic.co/t/issue-with-kubernetes-metric-data-fetch-by-meteicbeat/371404/3 "2024-12-03T19:42:10Z")

</div>



---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 3, 2024, 7:44pm UTC](https://discuss.elastic.co/t/issue-with-kubernetes-metric-data-fetch-by-meteicbeat/371404/4 "2024-12-03T19:44:09Z")

</div>

@Sam96 Please open only 1 topic and give it a bit of time. You are a new user, so the anti-spam filters will check because your post contains links.

I will close the other topic.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 3, 2024, 7:46pm UTC](https://discuss.elastic.co/t/issue-with-kubernetes-metric-data-fetch-by-meteicbeat/371404/5 "2024-12-03T19:46:43Z")

</div>

If you want to monitor Inside the kubernetes you should follow this in my opinion....

> **[Run Metricbeat on Kubernetes | Metricbeat Reference \[8.16\] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/running-on-kubernetes.html)**

If you want to monitor from outside you will need to follow this in detail

> **[Kubernetes module | Metricbeat Reference \[8.16\] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html)**

The error message indicate that those dataset are not metricsset are not available at the address:port you are providing...

Perhaps install metricbeat into the cluster....

---

<div class="post-metadata">

**Author:** ![Sam96](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Sam96](https://discuss.elastic.co/u/Sam96)\
**Post date:** [December 4, 2024, 6:17am UTC](https://discuss.elastic.co/t/issue-with-kubernetes-metric-data-fetch-by-meteicbeat/371404/6 "2024-12-04T06:17:29Z")

</div>

Hello ,

@stephenb , Thanks for your response .

For the first approach

we tried installing using the mainfest file Inside the kubernetes ,but seems like we are unable to fetch the metricbeats image and it is giving error  
containers:  
- name: metricbeat  
image: **[docker.elastic.co/beats/metricbeat-wolfi:8.16.1](http://docker.elastic.co/beats/metricbeat-wolfi:8.16.1)**

Errror : Error response from daemon: Get "[https://docker.elastic.co/v2/](https://docker.elastic.co/v2/)": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

For the second approach

if we are running it outside the kubernetes cluster what should be the ideal value for the address:port ,  
and how to verify that those metricsset are available or not at the address:port we are providing

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 4, 2024, 6:37am UTC](https://discuss.elastic.co/t/issue-with-kubernetes-metric-data-fetch-by-meteicbeat/371404/7 "2024-12-04T06:37:53Z")

</div>

I just tried [the sample metricbeat deployment file](https://raw.githubusercontent.com/elastic/beats/8.16/deploy/kubernetes/metricbeat-kubernetes.yaml) with only replacing the credentials and I could deploy to my K8s

 ![Screenshot 2024-12-03 at 10.57.55 PM](https://us1.discourse-cdn.com/elastic/original/3X/a/f/af62d6b1873bc5f7479e3258ec2fc7936250b7a5.png)

Perhaps you can not pull from the public docker Firewall or something... you would need to determine why. Here simple docker pull as well confirms good.

```auto
$ docker pull docker.elastic.co/beats/metricbeat-wolfi:8.16.1
8.16.1: Pulling from beats/metricbeat-wolfi
Digest: sha256:430a516d882e1ea1d8edc6a8e044b7cb384cf08405f3ab985f3de96e66e4199d
Status: Image is up to date for docker.elastic.co/beats/metricbeat-wolfi:8.16.1
docker.elastic.co/beats/metricbeat-wolfi:8.16.1

```

For deploying outside \You can also look at this

> **[beats/deploy/kubernetes/metricbeat at main · elastic/beats](https://github.com/elastic/beats/tree/main/deploy/kubernetes/metricbeat)**
>
> :tropical\_fish: Beats - Lightweight shippers for Elasticsearch &amp; Logstash - elastic/beats

You will need to inspect your cluster to see what the ports are on perhaps using something like lens

> **[Lens | The Kubernetes IDE](https://k8slens.dev/)**
>
> Lens IDE for Kubernetes. The only system you’ll ever need to take control of your Kubernetes clusters. Download it today!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 1, 2025, 10:22am UTC](https://discuss.elastic.co/t/issue-with-kubernetes-metric-data-fetch-by-meteicbeat/371404/9 "2025-01-01T10:22:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
