# Metricbeat Kubernetes Module

**URL:** <https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [July 5, 2017, 7:09am UTC](https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850 "2017-07-05T07:09:39Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sukhada\_sankpal369](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sukhada\_sankpal369](https://discuss.elastic.co/u/sukhada_sankpal369)\
**Post date:** [July 5, 2017, 7:09am UTC](https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850/1 "2017-07-05T07:09:39Z")

</div>

My kubernetes node is tls configured. I am tring to use the metricset node, system, pod, container and volume which would be fetched from https://IP\_k8s:10255. It gives me logs saying "error making http request: Get https://IP\_k8s:10255/stats/summary: http: server gave HTTP response to HTTPS client"

---

<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 5, 2017, 8:38am UTC](https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850/2 "2017-07-05T08:38:57Z")

</div>

Hi @sukhada_sankpal369,

Couuld you share the settings you are using for the module? I'm wondering if you put `https`in the `hosts` field

---

<div class="post-metadata">

**Author:** ![sukhada\_sankpal369](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sukhada\_sankpal369](https://discuss.elastic.co/u/sukhada_sankpal369)\
**Post date:** [July 5, 2017, 8:57am UTC](https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850/3 "2017-07-05T08:57:38Z")

</div>

metricbeat.modules:

# Node metrics, from kubelet:

- module: kubernetes  
protocol: https  
enabled: true  
metricsets:
  - node
  - system
  - pod
  - container
  - volume  
period: 10s  
in\_cluster: true  
hosts: ["[https://a.b.c.d:10255](https://a.b.c.d:10255)"]  
ssl.certificate\_authorities: ["ca.pem"]  
ssl.certificate: "abc.pem"  
ssl.key: "abc-key.pem"

---

<div class="post-metadata">

**Author:** ![sukhada\_sankpal369](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sukhada\_sankpal369](https://discuss.elastic.co/u/sukhada_sankpal369)\
**Post date:** [July 5, 2017, 8:58am UTC](https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850/4 "2017-07-05T08:58:31Z")

</div>

I tried using it without https. It was connecting using http.

---

<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 5, 2017, 9:00am UTC](https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850/5 "2017-07-05T09:00:34Z")

</div>

Uhm, it looks to me like the service doesn't provide HTTPS, you can use `http` instead, I think that should work.

You can test this by hand, using curl for instance:  
`$ curl http://ip_k8s:10255/stats/summary`  
and  
`$ curl https://ip_k8s:10255/stats/summary`

Which one is correct?

---

<div class="post-metadata">

**Author:** ![sukhada\_sankpal369](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sukhada\_sankpal369](https://discuss.elastic.co/u/sukhada_sankpal369)\
**Post date:** [July 5, 2017, 9:03am UTC](https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850/6 "2017-07-05T09:03:33Z")

</div>

curl command works with https://ip\_k8s:10255/stats/summary

---

<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 5, 2017, 9:36am UTC](https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850/7 "2017-07-05T09:36:35Z")

</div>

What's the output of curl in both cases?

---

<div class="post-metadata">

**Author:** ![sukhada\_sankpal369](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sukhada\_sankpal369](https://discuss.elastic.co/u/sukhada_sankpal369)\
**Post date:** [July 5, 2017, 10:25am UTC](https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850/8 "2017-07-05T10:25:05Z")

</div>

It is working fine with http.  
How to check for  
metricsets:  
- state\_node  
- state\_deployment  
- state\_replicaset  
- state\_pod  
- state\_container  
using CURL??

Also, I am not able to see data related to POD and Node

 ![](https://us1.discourse-cdn.com/elastic/original/3X/4/5/45275e59e3718f2356fcd9bca2fcd6cdd09ab5ca.png)

---

<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 5, 2017, 10:30am UTC](https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850/9 "2017-07-05T10:30:57Z")

</div>

That info comes from `kube-state-metrics`, you will need to launch this service in kubernetes: [https://github.com/kubernetes/kube-state-metrics](https://github.com/kubernetes/kube-state-metrics) (check [https://github.com/kubernetes/kube-state-metrics/tree/master/kubernetes](https://github.com/kubernetes/kube-state-metrics/tree/master/kubernetes))

then `kube-state-metrics` host dns should be available within the cluster, so you can use curl against it: `curl http://kube-state-metrics:8080`

Let me know how it goes

---

<div class="post-metadata">

**Author:** ![sukhada\_sankpal369](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@sukhada\_sankpal369](https://discuss.elastic.co/u/sukhada_sankpal369)\
**Post date:** [July 5, 2017, 10:58am UTC](https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850/10 "2017-07-05T10:58:33Z")

</div>

Hey Thanks!! I shall try this and let you know about it.  
For now you may close the issue.

---

<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, 2017, 10:58am UTC](https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850/11 "2017-08-02T10:58:42Z")

</div>

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