kibana 7.2 can't reach elasticsearch on kubernetes

7/10/2019

I'm testing the latest version of the Elastic Stack (7.2.0) and i can't seem to connect Kibana to Elasticsearch, but when i rollback to 6.8.1 it works. Any ideas ?


Kibana Deploy & Service

apiVersion: apps/v1
kind: Deployment
metadata:
  name: kibana
  namespace: *************
  labels:
    component: kibana
spec:
  replicas: 1
  selector:
    matchLabels:
      component: kibana
  template:
    metadata:
      labels:
        component: kibana
    spec:
      containers:
      - name: kibana
        image: docker.elastic.co/kibana/kibana:7.2.0
        resources:
          limits:
            cpu: 1000m
          requests:
            cpu: 100m
        env:
          - name: ELASTICSEARCH_URL
            value: http://elastic.****************:80
        ports:
        - containerPort: 5601
          name: kibana
          protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
  name: kibana
  namespace: *************
  labels:
    component: kibana
spec:
  selector:
    component: kibana
  ports:
  - port: 80
    protocol: "TCP"
    name: "http"
    targetPort: 5601

I am using an ingress but Kibana comlpetely ignores the ELASTICSEARCH_URL value when i try to deploy the 7.2.0 but it works when i rollback to the 6.8.1. I don't know if this methode is no longer supported on the 7.2.0, i've been all over trying to find some documentation but no luck.

-- user11765676
kibana-7
kubernetes

2 Answers

7/11/2019

update ingest service dns name in ELASTICSEARCH_URL as shown below. assuming kibana and es are running in the same k8s cluster

          - name: ELASTICSEARCH_URL
            value: http://ingest.<namespace>.svc.cluster.local:9200

update the correct namespace they are running in

-- P Ekambaram
Source: StackOverflow

7/11/2019

As of Kibana 7.0 elasticsearch.url is no longer valid and it is now elasticsearch.hosts: https://www.elastic.co/guide/en/kibana/7.x/breaking-changes-7.0.html#_literal_elasticsearch_url_literal_is_no_longer_valid.

The environment variables translate to these settings names. In this case, the new environment variable would be ELASTICSEARCH_HOSTS. See the example at https://www.elastic.co/guide/en/kibana/7.2/docker.html.

-- Andy Shinn
Source: StackOverflow