# How to configure metricbeat k8s to use ssl connection to ES

**URL:** https://discuss.elastic.co/t/how-to-configure-metricbeat-k8s-to-use-ssl-connection-to-es/342538
**Category:** Beats
**Tags:** metricbeat
**Created:** [September 7, 2023, 3:50pm UTC](https://discuss.elastic.co/t/how-to-configure-metricbeat-k8s-to-use-ssl-connection-to-es/342538 "2023-09-07T15:50:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Mihai-CMM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mihai-cmm/32/125429_2.png) [@Mihai-CMM](https://discuss.elastic.co/u/Mihai-CMM)
#### Post date: [September 7, 2023, 3:50pm UTC](https://discuss.elastic.co/t/how-to-configure-metricbeat-k8s-to-use-ssl-connection-to-es/342538/1 "2023-09-07T15:50:11Z")

</div>

Per title i find it impssobile to configure metricbeat and ES on k8s env.  
Can i please get a full working env for metricbeat?  
[https://raw.githubusercontent.com/elastic/beats/8.9/deploy/kubernetes/metricbeat-kubernetes.yaml](https://raw.githubusercontent.com/elastic/beats/8.9/deploy/kubernetes/metricbeat-kubernetes.yaml)  
I dont see any option to say that ES with xpack enable expects TLS

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [September 7, 2023, 5:50pm UTC](https://discuss.elastic.co/t/how-to-configure-metricbeat-k8s-to-use-ssl-connection-to-es/342538/2 "2023-09-07T17:50:26Z")

</div>

Hi @Mihai-CMM  
You have to get the CA from when you created Elasticsearch and then make the CA available to metricbeat via mounts

Perhaps take a look at this post. I think this is a pretty good example

> [@Filebeat running on Kubernetes connected to Elasticsearch using SSL](https://discuss.elastic.co/t/filebeat-running-on-kubernetes-connected-to-elasticsearch-using-ssl/279946):
>
> I would like to use filebeat on Kubernetes and connect it to a secured Elasticsearch server, using certificates. I did a search to find how to do this but only found an un-answered related question. After some test I got it, so I will share my findings to help anybody else. These are the steps: Follow the original [documentation](https://www.elastic.co/guide/en/beats/filebeat/current/running-on-kubernetes.html) to download the yaml file. As shown on the documentation, update this file with the correct details about the Elasticsearch server: hostname, port, user and passw…

---

<div class="post-metadata">

### Author: ![Mihai-CMM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mihai-cmm/32/125429_2.png) [@Mihai-CMM](https://discuss.elastic.co/u/Mihai-CMM)
#### Post date: [September 8, 2023, 6:50am UTC](https://discuss.elastic.co/t/how-to-configure-metricbeat-k8s-to-use-ssl-connection-to-es/342538/3 "2023-09-08T06:50:31Z")

</div>

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: [October 6, 2023, 8:51am UTC](https://discuss.elastic.co/t/how-to-configure-metricbeat-k8s-to-use-ssl-connection-to-es/342538/4 "2023-10-06T08:51:08Z")

</div>

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