# How to create a dashboard to monitor CPU and memory usage of Kubernetes cluster?

**URL:** <https://discuss.elastic.co/t/how-to-create-a-dashboard-to-monitor-cpu-and-memory-usage-of-kubernetes-cluster/308402>\
**Category:** Kibana\
**Created:** [June 28, 2022, 9:01pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-to-monitor-cpu-and-memory-usage-of-kubernetes-cluster/308402 "2022-06-28T21:01:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nimit\_Batham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nimit_batham/32/106918_2.png) [@Nimit\_Batham](https://discuss.elastic.co/u/Nimit_Batham)\
**Post date:** [June 28, 2022, 9:01pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-to-monitor-cpu-and-memory-usage-of-kubernetes-cluster/308402/1 "2022-06-28T21:01:41Z")

</div>

How to create a dashboard to monitor CPU and memory usage of Kubernetes cluster?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 28, 2022, 11:23pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-to-monitor-cpu-and-memory-usage-of-kubernetes-cluster/308402/2 "2022-06-28T23:23:03Z")

</div>

How are you sending the monitoring data to Elasticsearch?

---

<div class="post-metadata">

**Author:** ![Nimit\_Batham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nimit_batham/32/106918_2.png) [@Nimit\_Batham](https://discuss.elastic.co/u/Nimit_Batham)\
**Post date:** [June 29, 2022, 4:16pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-to-monitor-cpu-and-memory-usage-of-kubernetes-cluster/308402/3 "2022-06-29T16:16:30Z")

</div>

Elasticsearch is getting it from kubernetes cluster. I don't know how it's done but i can see fields like kubernetes.container.cpu.usage.core.ns in kibana under metricbeat

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 29, 2022, 9:08pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-to-monitor-cpu-and-memory-usage-of-kubernetes-cluster/308402/4 "2022-06-29T21:08:16Z")

</div>

Ok then you're using Metricbeat. It has prebuilt dashboards for this sort of thing, take a look at [Metricbeat quick start: installation and configuration | Metricbeat Reference [8.3] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-installation-configuration.html#setup-assets) to load them.

---

<div class="post-metadata">

**Author:** ![Nimit\_Batham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nimit_batham/32/106918_2.png) [@Nimit\_Batham](https://discuss.elastic.co/u/Nimit_Batham)\
**Post date:** [June 30, 2022, 3:58pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-to-monitor-cpu-and-memory-usage-of-kubernetes-cluster/308402/5 "2022-06-30T15:58:31Z")

</div>

I have metricbeat installed but my organization has removed all pre build dashboards. Can you share the calculation behind pre build dashboard.

---

<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:** [June 30, 2022, 10:10pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-to-monitor-cpu-and-memory-usage-of-kubernetes-cluster/308402/6 "2022-06-30T22:10:09Z")

</div>

Hi @Nimit_Batham Its not just a simple calculation.... the dashboards have many visualizations

What version of the Elastic Stack are you on?

---

<div class="post-metadata">

**Author:** ![Nimit\_Batham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nimit_batham/32/106918_2.png) [@Nimit\_Batham](https://discuss.elastic.co/u/Nimit_Batham)\
**Post date:** [July 1, 2022, 7:19pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-to-monitor-cpu-and-memory-usage-of-kubernetes-cluster/308402/7 "2022-07-01T19:19:45Z")

</div>

I understand that dashboard would have many visualizations and i need the maths done behind those visualization. Atleast for basic ones, like cpu usage and memory usage. I am using v 7.16.3

---

<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:** [July 1, 2022, 7:49pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-to-monitor-cpu-and-memory-usage-of-kubernetes-cluster/308402/8 "2022-07-01T19:49:25Z")

</div>

Either you load the dashboards your self... or just start working with it ... we do not a document describing each visualization... very unusual to not be able to load the dashboards...

I am not really sure what you are asking for ... This is normal metrics stuff... avg / min / max... if you want to use some of the counters like the nanoseconds above... then you have to be a bit more sophisticated

I would start with the normal ones and start explore... you need to just dive in and get started!

If you want the average of the this.. then apply average, if you want max apply max etc.

> **`kubernetes.container.cpu.usage.node.pct`**
> 
> CPU usage as a percentage of the total node allocatable CPU
> 
> Most of them are just reporting the collected metrics which you can view in the exported fields sections of the docs

You can looks at the exported fields

> **[System fields | Metricbeat Reference \[7.16\] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/7.16/exported-fields-system.html)**

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

then go try lens... dive in..

 ![Screen Shot 2022-07-01 at 12.42.16 PM](https://us1.discourse-cdn.com/elastic/original/3X/9/c/9cd93ebf028e07de562abee48941ccfeba6e6f36.jpeg)

Here is an example of the nano cores etc but these are not documented in detail anywhere

 ![Screen Shot 2022-07-01 at 12.56.55 PM](https://us1.discourse-cdn.com/elastic/original/3X/1/7/178965b0500c11c3ab8efb734e3b735d6db3d904.png)

---

<div class="post-metadata">

**Author:** ![Nimit\_Batham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nimit_batham/32/106918_2.png) [@Nimit\_Batham](https://discuss.elastic.co/u/Nimit_Batham)\
**Post date:** [July 5, 2022, 4:49pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-to-monitor-cpu-and-memory-usage-of-kubernetes-cluster/308402/9 "2022-07-05T16:49:19Z")

</div>

Thanks, this is good information. Let me give you an example of what i am trying. I have made all the graphs in Grafana by using this metrics for CPU usage- sum(rate(container\_cpu\_usage\_seconds\_total)) grouped by container and filtered for a particular namespace. Now, I want to create same graphs in Kibana.  
[https://www.replex.io/blog/kubernetes-in-production-the-ultimate-guide-to-monitoring-resource-metrics](https://www.replex.io/blog/kubernetes-in-production-the-ultimate-guide-to-monitoring-resource-metrics)

---

<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:** [August 2, 2022, 4:49pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-to-monitor-cpu-and-memory-usage-of-kubernetes-cluster/308402/10 "2022-08-02T16:49:22Z")

</div>

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