Ingress for ECK Kibana

8/17/2021

I have installed the ECK crds and operator following the Elasticsearch documentation, the cluster is up and runs fine, I can also port forward the kibana service and I am able to use the ui with this command:

kubectl port-forward service/kibana-kb-http 5601

However, if I write an Ingress I just cannot access it, at the very best I can get a warning about the certificate and at the worst nothing at all.

I am also using Traefik, and my Kibana is:

apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: kibana
  labels:
    various...
spec:
  version: 7
  count: 1
  elasticsearchRef:
    name: "elasticsearch"
  podTemplate:
    spec:
      http:
        tls:
          selfSignedCertificate:
            disabled: false
      containers:
        - name: kibana
          resources:
            limits:
              memory: 2Gi
              cpu: 2

One of my attempts with the ingress:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: k-ingress
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  rules:
    - host: kibana.host.com
      http:
        paths:
          - backend:
              serviceName: kibana-kb-http
              servicePort: 5601
            path: /

I have found other questions about it, but they are either too old or not replied. Any suggestion?

-- Pampa Nello
kibana
kubernetes
kubernetes-ingress

1 Answer

8/18/2021

I went back to the Kibana documentation and I found that that it was just necessary to modify the Kibana yaml file to:

apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: kibana
  labels:
    various...
spec:
  version: 7
  http:
    service:
      spec:
        type: LoadBalancer
    tls:
      selfSignedCertificate:
        disabled: true
  count: 1
  elasticsearchRef:
    name: "elasticsearch"
  podTemplate:
    containers:
      - name: kibana
        resources:
          limits:
            memory: 2Gi
            cpu: 2

Notice that the tls part has been moved to the spec section and not in the podTemplate and that LoadBalancer has been added. Now, I can connect to Kibana using http://my-cluster:5601

-- Pampa Nello
Source: StackOverflow