Search code examples
kibanakubernetes-ingress

Ingress configuration to access Kibana from the internet


I've been following this guide here https://www.elastic.co/guide/en/cloud-on-k8s/master/k8s-deploy-kibana.html, and I have also configured the following ingress:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: kibana-ui
  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/rewrite-target: "false"
spec:
  ingressClassName: nginx
  rules:
  - http:
      paths:
      - path: /kibana
        pathType: Prefix
        backend:
          service:
            name: quickstart-kb-http
            port:
              number: 5601

The port forwarding worked just fine But with this ingress, I get a 502 page. How can i fix this?


Solution

  • I followed the suggestion in this thread here. So I added the following annotation:

    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
    

    the full ingress config:

    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: kibana-ui
      annotations:
        nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
    spec:
      ingressClassName: nginx
      tls:
      - hosts:
          - xx.xx.xx.xx.nip.io
        secretName: quickstart-kb-http-ca-public
      rules:
      - host: xx.xx.xx.xx.nip.io
        http:
          paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: quickstart-kb-http
                port:
                  number: 5601
    

    Also i used the nip.io workaround. Coz apparently you need to use a name as opposed to ip in the host section above.