# Metricbeat installing on Kubenetes cluster ERROR

**URL:** <https://discuss.elastic.co/t/metricbeat-installing-on-kubenetes-cluster-error/141724>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [July 26, 2018, 9:15am UTC](https://discuss.elastic.co/t/metricbeat-installing-on-kubenetes-cluster-error/141724 "2018-07-26T09:15:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![b22565875b81d856c5b0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/b22565875b81d856c5b0/32/33762_2.png) [@b22565875b81d856c5b0](https://discuss.elastic.co/u/b22565875b81d856c5b0)\
**Post date:** [July 26, 2018, 9:15am UTC](https://discuss.elastic.co/t/metricbeat-installing-on-kubenetes-cluster-error/141724/1 "2018-07-26T09:15:33Z")

</div>

I have a problem with Metricbeat installation on my cluster. I have used a kubernetes module template:[https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-kubernetes.html](https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-kubernetes.html).

In this place (at the end of the kubenetes module example):  
hosts: ["https://${KUBERNETES\_SERVICE\_HOST}:${KUBERNETES\_SERVICE\_PORT}"],  
I`ve inserted my Kubernetes API server host and port. When I try to run sudo metricbeat -c /etc/metricbeat/metricbeat.yml test config, I recieve this error:

Exiting: 2 errors: 1 error: fail to get kubernetes client: Unable to  
get in cluster configuration: unable to load in-cluster configuration,  
KUBERNETES\_SERVICE\_HOST and KUBERNETES\_SERVICE\_PORT must be defined; 1  
error: metricset 'kubernetes/apiserver' is not registered, metricset  
not found.

I tried to export needed enviroment varibles, but reaction was the same. Could anyone help me to solve this problem?

---

<div class="post-metadata">

**Author:** ![b22565875b81d856c5b0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/b22565875b81d856c5b0/32/33762_2.png) [@b22565875b81d856c5b0](https://discuss.elastic.co/u/b22565875b81d856c5b0)\
**Post date:** [July 26, 2018, 9:16am UTC](https://discuss.elastic.co/t/metricbeat-installing-on-kubenetes-cluster-error/141724/2 "2018-07-26T09:16:26Z")

</div>

So, i tried different approaches. Firstly, with command export KUBERNETES\_SERVICE\_HOST and PORT, i defined variables, which i found using command "kubectl cluster-info", also this variables i could find in one of clusters pods yml file as "env": [ { "name": "KUBERNETES\_SERVICE\_HOST", "value": "xxxxx" }, { "name": "KUBERNETES\_SERVICE\_PORT", "value": "xxxxx".  
But there were no changes in the reaction.  
Secondly i tried insert ENV in metricbeat yml config file. As in privious situation, reaction didn`t changed. I also delpoyed Metricbeat as a Daemon set, using kubectl create -f metricbeat-kubernetes.yaml. All works fine. Metricbeat send info about concrete node. But for visualization in kibana, i need (i think so) to send overall information about cluster (pods, nodes and so on), installing metricbeat as service on cluster.

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [July 26, 2018, 11:50am UTC](https://discuss.elastic.co/t/metricbeat-installing-on-kubenetes-cluster-error/141724/3 "2018-07-26T11:50:08Z")

</div>

Hi @b22565875b81d856c5b0,

If you followed [https://www.elastic.co/guide/en/beats/metricbeat/current/running-on-kubernetes.html](https://www.elastic.co/guide/en/beats/metricbeat/current/running-on-kubernetes.html) and it's working, you only need to run `metricbeat setup` from any Metricbeat instance to deploy the dashboards (you can do this step from your workstation): [https://www.elastic.co/guide/en/beats/metricbeat/6.3/load-kibana-dashboards.html](https://www.elastic.co/guide/en/beats/metricbeat/6.3/load-kibana-dashboards.html)

Best regards

---

<div class="post-metadata">

**Author:** ![b22565875b81d856c5b0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/b22565875b81d856c5b0/32/33762_2.png) [@b22565875b81d856c5b0](https://discuss.elastic.co/u/b22565875b81d856c5b0)\
**Post date:** [July 27, 2018, 12:16pm UTC](https://discuss.elastic.co/t/metricbeat-installing-on-kubenetes-cluster-error/141724/4 "2018-07-27T12:16:44Z")

</div>

If i will follow your instructions, i could get whole info about CLUSTER ( all nodes, all pods etc.)?

---

<div class="post-metadata">

**Author:** ![b22565875b81d856c5b0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/b22565875b81d856c5b0/32/33762_2.png) [@b22565875b81d856c5b0](https://discuss.elastic.co/u/b22565875b81d856c5b0)\
**Post date:** [July 30, 2018, 7:11am UTC](https://discuss.elastic.co/t/metricbeat-installing-on-kubenetes-cluster-error/141724/5 "2018-07-30T07:11:22Z")

</div>

UP!!!

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [July 30, 2018, 8:28am UTC](https://discuss.elastic.co/t/metricbeat-installing-on-kubenetes-cluster-error/141724/6 "2018-07-30T08:28:56Z")

</div>

Hi,

Yes, you should get that information if you go over instructions.

Best regards

---

<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 27, 2018, 8:30am UTC](https://discuss.elastic.co/t/metricbeat-installing-on-kubenetes-cluster-error/141724/7 "2018-08-27T08:30:45Z")

</div>

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