3

I'm using ECK 1.5.0 and I have to use Ingress to expose Elasticsearch. But I'm getting a 502 gateway when I go to the url (http://my-db-url.com). I have confirmed the database is running fine and able to collect / display data.

I was only able to find solutions to exposing Kibana with Ingress on the web but those were not working for me.

Heres my elasticsearch.yaml (contains Elasticsearch object and Ingress object):

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: my-db
spec:
  version: 7.12.0
  volumeClaimDeletePolicy: DeleteOnScaledownOnly
  nodeSets:
  - name: default
    count: 3
    config:
      node.store.allow_mmap: false
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 10Gi
        storageClassName: longhorn

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-db-ingress
  namespace: my-namespace
  annotations:
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "300"
    nginx.ingress.kubernetes.io/upstream-vhost: "$http_host"
spec:
  rules:
    - host: my-db-url.com
      http:
        paths:
          - backend:
              serviceName: my-db-es-http
              servicePort: 9200
pear
  • 101
  • 3
  • 10
  • 1
    nvm found answer, just needed to disable TLS. There's probably an nginx annotation though. I should've been checking one of the elasticsearch pods to see the error message – pear Aug 23 '21 at 17:10
  • Hi @Kpear As I understand, you have resolved your problem, right? – Andrew Skorkin Aug 24 '21 at 07:49
  • Hi @AndrewSkorkin yes I have and I answered the question with my solution – pear Aug 24 '21 at 21:23

1 Answers1

4

Turns out the same question was asked here: https://discuss.elastic.co/t/received-plaintext-http-traffic-on-an-https-channel-closing-connection/271380

and the solution is to force HTTPS using annotations, which for the nginx ingress controller can be found here: https://github.com/elastic/helm-charts/issues/779#issuecomment-781431675

pear
  • 101
  • 3
  • 10