# How to expose elasticsearch externally

**URL:** <https://discuss.elastic.co/t/how-to-expose-elasticsearch-externally/250704>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [October 1, 2020, 3:02pm UTC](https://discuss.elastic.co/t/how-to-expose-elasticsearch-externally/250704 "2020-10-01T15:02:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kay\_Khan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kay_khan/32/45028_2.png) [@Kay\_Khan](https://discuss.elastic.co/u/Kay_Khan)\
**Post date:** [October 1, 2020, 3:02pm UTC](https://discuss.elastic.co/t/how-to-expose-elasticsearch-externally/250704/1 "2020-10-01T15:02:49Z")

</div>

Hi i would like to expose my elasticsearch cluster in kubernetes created using ECK so it can be accessed externally.

I have a requriement to setup `Functionbeat` to ship aws lambda cloudwatch logs to elastcsearch.  
Please see `Step 2: Connect to the Elastic Stack`[Functionbeat quick start: installation and configuration | Functionbeat Reference [8.11] | Elastic](https://www.elastic.co/guide/en/beats/functionbeat/current/functionbeat-installation-configuration.html)

**Attempt** :

I have an elastic load balancer that has haproxy running on it which i use to expose other k8 services externally such as frontends. Ive attempted to modify this to also allow me to expose elasticsearch.

**haproxy**

```
frontend elasticsearch
  bind *:9200
  acl host_data_elasticsearch hdr(host) -i elasticsearch.acme.com
  use_backend elasticsearchApp if host_data_elasticsearch

backend elasticsearchApp
  server data-es data-es-es-http:9200 check rise 1 ssl verify none

```

Im attempting to see if i can connect using the following curl command:

`curl -u "elastic:$ELASTIC_PASSWORD" -k "https://elasticsearch.acme.com:9200"`

However i get the following error:

> curl: (35) error:1408F10B:SSL routines:ssl3\_get\_record:wrong version number

In the browser if i navigate to the url i get

> This site can’t provide a secure connection  
> **[elasticsearch.acme.com](http://elasticsearch.acme.com)** sent an invalid response.  
> ERR\_SSL\_PROTOCOL\_ERROR

---

<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:** [November 4, 2022, 8:14am UTC](https://discuss.elastic.co/t/how-to-expose-elasticsearch-externally/250704/2 "2022-11-04T08:14:30Z")

</div>


