Elastic_agent.metricbeat error fetching data from metricsets.kubernetes.system

Sir,

Deployed elastic agent (fleet managed) in kubernetes cluster but the metric related details are not getting shown in the dashboards and observing the below errors. Kindly help us resolve the issue.

[elastic_agent.metricbeat][error] Error fetching data for metricset kubernetes.system: error doing HTTP request to fetch 'system' Metricset data: error making http request: Get "https://worker2-accountshr:10250/stats/summary": lookup worker2-accountshr on 10.11.10.11:53: no such host

elastic_agent.metricbeat
[elastic_agent.metricbeat][error] Error fetching data for metricset kubernetes.volume: error doing HTTP request to fetch 'volume' Metricset data: error making http request: Get "https://worker2-accountshr:10250/stats/summary": lookup worker2-accountshr on 10.11.10.11:53: no such host

As per my observation the elastic agent is not able resolve the dns of worker2-accountshr..

By adding the ip of the nodes in the rancher for the elastic have resolved the issue.