# Kubernetes - Inventory showing elastic agents instead of Host names

**URL:** <https://discuss.elastic.co/t/kubernetes-inventory-showing-elastic-agents-instead-of-host-names/323660>\
**Category:** Elastic Agent\
**Tags:** filebeat, metricbeat\
**Created:** [January 21, 2023, 9:19pm UTC](https://discuss.elastic.co/t/kubernetes-inventory-showing-elastic-agents-instead-of-host-names/323660 "2023-01-21T21:19:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pablo\_Halamaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pablo_halamaj/32/116243_2.png) [@Pablo\_Halamaj](https://discuss.elastic.co/u/Pablo_Halamaj)\
**Post date:** [January 21, 2023, 9:19pm UTC](https://discuss.elastic.co/t/kubernetes-inventory-showing-elastic-agents-instead-of-host-names/323660/1 "2023-01-21T21:19:21Z")

</div>

Hello,

I set up Fleet and a bunch of agents running on a Kubernetes (K8S) cluster with the Kubernetes' integration.  
So far the log and metrics integration kind of work ( we see them on the DSs, the dashboards and the discovery view).  
My problem is when i try to see the inventory graph ( at the observability section) because instead of seeing all my Kubernetes host i see all the elastic-agents and i'm unable to see the overall usage of the K8S nodes (like full node CPU and Memory usage).

My Daemonset to run the agents is based on [https://raw.githubusercontent.com/elastic/elastic-agent/8.6/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml](https://raw.githubusercontent.com/elastic/elastic-agent/8.6/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml) changing only the values for our environment.

The kubernetes integration used is the default with the aggregation of the orchestator.cluster field as pointed in here -\> [Run Elastic Agent on Amazon EKS managed by Fleet | Fleet and Elastic Agent Guide [master] | Elastic](https://www.elastic.co/guide/en/fleet/master/running-on-eks-managed-by-fleet.html)

Do we have any option in order for the agents to show the name of the node where they are running ?  
In case we don't, what should we configurate in order to consolidate the metrics of the nodes when the pod are deleted and change they name in order to see a continuous metric historic for the K8S node no mater the agent's name ?

Best.

---

<div class="post-metadata">

**Author:** ![Tetiana\_Kravchenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tetiana_kravchenko/32/102683_2.png) [@Tetiana\_Kravchenko](https://discuss.elastic.co/u/Tetiana_Kravchenko)\
**Post date:** [January 27, 2023, 10:20am UTC](https://discuss.elastic.co/t/kubernetes-inventory-showing-elastic-agents-instead-of-host-names/323660/2 "2023-01-27T10:20:13Z")

</div>

Hello @Pablo_Halamaj

> My problem is when i try to see the inventory graph ( at the observability section) because instead of seeing all my Kubernetes host i see all the elastic-agents and i'm unable to see the overall usage of the K8S nodes (like full node CPU and Memory usage).

Correctly I understand that in `Observability > Infrastructure > Inventory` you have selected `Show` by `Hosts`, but you are getting not the host names on the graph, but the elastic-agents pod names? or you see all pods (not only elastic-agents one)?

Do you use EKS or self managed K8S cluster?

---

<div class="post-metadata">

**Author:** ![Pablo\_Halamaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pablo_halamaj/32/116243_2.png) [@Pablo\_Halamaj](https://discuss.elastic.co/u/Pablo_Halamaj)\
**Post date:** [January 29, 2023, 5:34pm UTC](https://discuss.elastic.co/t/kubernetes-inventory-showing-elastic-agents-instead-of-host-names/323660/3 "2023-01-29T17:34:31Z")

</div>

Hello @Tetiana_Kravchenko ,

Thanks for the time to answer my post.

When i go to `Observability > Infrastructure > Inventory` i see:

- a big box with the label "ALL"
- inside the box all the agents including ( fleet-server, APM agents, agents deployed with integration for kubernetes).
- the only ones showing data are the fleet-server and the APM.
- i don't see any other pods.

We use a self managed K8S cluster.  
The fleet-server and the APM agents are in the same K8S cluster as the elastic + kibana deploy.  
The elastic-agents are on another k8s cluster.  
All the K8S cluster are provided by the same Cloud provider ( Oracle ).

Here are some screenshoot to better illustrate the points above.

- Inventory View:  

- Fleet detailed view  

- APM detailed view  

- Agents detailed view  

Best,

---

<div class="post-metadata">

**Author:** ![Tetiana\_Kravchenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tetiana_kravchenko/32/102683_2.png) [@Tetiana\_Kravchenko](https://discuss.elastic.co/u/Tetiana_Kravchenko)\
**Post date:** [February 7, 2023, 4:44pm UTC](https://discuss.elastic.co/t/kubernetes-inventory-showing-elastic-agents-instead-of-host-names/323660/4 "2023-02-07T16:44:19Z")

</div>

Hi @Pablo_Halamaj  
Thank you for sharing.  
It is strange. In case selected `Show`: `Hosts` there should be provided a list of `Kubernetes host`, not the pods. Could you please check if `host.name` field is propagated in elasticsearch documents, and if it contains the correct values?

---

<div class="post-metadata">

**Author:** ![Pablo\_Halamaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pablo_halamaj/32/116243_2.png) [@Pablo\_Halamaj](https://discuss.elastic.co/u/Pablo_Halamaj)\
**Post date:** [March 2, 2023, 7:13pm UTC](https://discuss.elastic.co/t/kubernetes-inventory-showing-elastic-agents-instead-of-host-names/323660/5 "2023-03-02T19:13:07Z")

</div>

Hi @Tetiana_Kravchenko,

Here the `host.name` field from the document in the 'logs-_' and 'metrics-_' dataviews.  
All of theme show the pod's name.

![Screenshot at 2023-03-02 15-58-07](https://us1.discourse-cdn.com/elastic/original/3X/3/c/3c6d0a548ce2e406de2309754eee48714385bf12.png)  
 ![Screenshot at 2023-03-02 15-58-25](https://us1.discourse-cdn.com/elastic/original/3X/6/1/61ab2c519f3623b26783441d33c93a3e5165e940.png)  
 ![Screenshot at 2023-03-02 16-01-40](https://us1.discourse-cdn.com/elastic/original/3X/d/4/d4f1487d22f570a23a0051bbafc14cd69badd521.png)

Should we add some config in the policy to fix this ?

Best

---

<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:** [March 30, 2023, 7:13pm UTC](https://discuss.elastic.co/t/kubernetes-inventory-showing-elastic-agents-instead-of-host-names/323660/6 "2023-03-30T19:13:30Z")

</div>

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