# \[solved\] \[kubernetes module\] unable to enable ssl

**URL:** <https://discuss.elastic.co/t/solved-kubernetes-module-unable-to-enable-ssl/124603>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [March 19, 2018, 3:53pm UTC](https://discuss.elastic.co/t/solved-kubernetes-module-unable-to-enable-ssl/124603 "2018-03-19T15:53:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamelg](https://avatars.discourse-cdn.com/v4/letter/h/ecae2f/32.png) [@hamelg](https://discuss.elastic.co/u/hamelg)\
**Post date:** [March 19, 2018, 3:53pm UTC](https://discuss.elastic.co/t/solved-kubernetes-module-unable-to-enable-ssl/124603/1 "2018-03-19T15:53:17Z")

</div>

Hello

according to the documentation, kubernetes module supports ssl connection [1].  
But despite ssl setting enabled, it still talks http to the kubelet service.  
Any ideas ?

[1] [https://www.elastic.co/guide/en/beats/metricbeat/6.2/metricbeat-module-kubernetes.html](https://www.elastic.co/guide/en/beats/metricbeat/6.2/metricbeat-module-kubernetes.html)

```
metricbeat.modules:
# Node metrics, from kubelet:
- module: kubernetes
  metricsets:
    - node
    - system
    - pod
    - container
    - volume
  period: 10s
  hosts: ["localhost:10250"]
  ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]
  ssl.certificate: "/etc/pki/client/cert.pem"
  ssl.key: "/etc/pki/client/cert.key"
```

---

<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:** [March 19, 2018, 4:20pm UTC](https://discuss.elastic.co/t/solved-kubernetes-module-unable-to-enable-ssl/124603/2 "2018-03-19T16:20:17Z")

</div>

Hi @hamelg, you will need to update your `hosts` setting, try something like: `["https://localhost:10250"]`

Best regards

---

<div class="post-metadata">

**Author:** ![hamelg](https://avatars.discourse-cdn.com/v4/letter/h/ecae2f/32.png) [@hamelg](https://discuss.elastic.co/u/hamelg)\
**Post date:** [March 19, 2018, 5:27pm UTC](https://discuss.elastic.co/t/solved-kubernetes-module-unable-to-enable-ssl/124603/3 "2018-03-19T17:27:29Z")

</div>

Yes, standard kubelet ports are 10250 for https and 10255 for http.

I am sure what i say. SSL settings have no effect. Try it.  
I am not alone to encounter this issue

> [@Metricbeat Kubernetes Module](https://discuss.elastic.co/t/metricbeat-kubernetes-module/91850):
>
> 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:** [March 20, 2018, 8:37am UTC](https://discuss.elastic.co/t/solved-kubernetes-module-unable-to-enable-ssl/124603/4 "2018-03-20T08:37:26Z")

</div>

Hi again,

Can you paste the config you are testing? There is something odd in the log you are pasting, as it's reporting port 10255

---

<div class="post-metadata">

**Author:** ![hamelg](https://avatars.discourse-cdn.com/v4/letter/h/ecae2f/32.png) [@hamelg](https://discuss.elastic.co/u/hamelg)\
**Post date:** [March 20, 2018, 9:17am UTC](https://discuss.elastic.co/t/solved-kubernetes-module-unable-to-enable-ssl/124603/5 "2018-03-20T09:17:04Z")

</div>

```
- module: kubernetes
  metricsets:
    - node
    - system
    - pod
    - container
    - volume
  period: 10s
  hosts: ["localhost:10250"]
  ssl.certificate_authorities: ["/etc/origin/node/ca.crt"]
  ssl.certificate: "/etc/origin/node/system:node:xxx.crt"
  ssl.key: "/etc/origin/node/system:node:xxx.key"

```

as you can see in the error message, metricbeat connect to the kubelet service without SSL.

```
error making http request: Get http://localhost:10250/stats/summary: net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
```

---

<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:** [March 20, 2018, 9:25am UTC](https://discuss.elastic.co/t/solved-kubernetes-module-unable-to-enable-ssl/124603/6 "2018-03-20T09:25:26Z")

</div>

> [@hamelg](#):
>
> hosts: ["localhost:10250"]

Should be:

```auto
  hosts: ["https://localhost:10250"]

```

---

<div class="post-metadata">

**Author:** ![hamelg](https://avatars.discourse-cdn.com/v4/letter/h/ecae2f/32.png) [@hamelg](https://discuss.elastic.co/u/hamelg)\
**Post date:** [March 20, 2018, 9:45am UTC](https://discuss.elastic.co/t/solved-kubernetes-module-unable-to-enable-ssl/124603/7 "2018-03-20T09:45:33Z")

</div>

Great, it works now !  
thank you

---

<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:** [April 17, 2018, 9:51am UTC](https://discuss.elastic.co/t/solved-kubernetes-module-unable-to-enable-ssl/124603/8 "2018-04-17T09:51:20Z")

</div>

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