How to expose elasticsearch externally

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


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.


frontend elasticsearch
  bind *:9200
  acl host_data_elasticsearch hdr(host) -i
  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 ""

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 sent an invalid response.