<p>I have Elasticsearch POD + SERVICE, and Kibana POD + SERVICE. I'm trying to connect my Kibana POD to Elasticsearch service, but I get connection errors.</p>

<p>This is my yaml of Kibaba POD:</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: kibana
  labels:
    app: kibana
spec:
  ports:
  containers:
  - name: kibana
    image: kibana:6.6.1
    command: ["/bin/sh"]
    args: ["-c", "bin/kibana --elasticsearch.url='elasticsearch-service:9200'"]
</code></pre>

<p>I get the following errors:</p>

<pre><code> FATAL  ValidationError: child "elasticsearch" fails because [child "hosts" fails because [single value of "hosts" fails because ["hosts" must be a valid uri with a scheme matching the http|https pattern]]]
</code></pre>

<p>From what I understand, I get error because the elasticsearch.url, doesn't start with http/https. So I tried to run         <code>args: ["-c", "bin/kibana --elasticsearch.url='http://elasticsearch-service:9200'"]</code>, but I get also connection errors (I think because service is not meant to be pointed with http/https).</p>

<p>This is the yaml of elasticsearch service (which works well):</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: elasticsearch-service
spec:
  ports:
  - port: 9200
    name: serving
    protocol: TCP
  - port: 9300
    name: node2node
    protocol: TCP
  selector:
    app: elasticsearch
</code></pre>

<p>With other PODs I could connect with elasticsearch-service:9200, but Kibana demends http/https. How can I make them connect?</p>

Yagel
<p>I managed to fix it by adding:</p>

<pre><code>env:
  - name: ELASTICSEARCH_URL
    value: "http://elasticsearch-service:9200"
  - name: ELASTICSEARCH_PORT
    value: "9200"
  - name: SERVER_BASEPATH
    value: /api/v1/namespaces/default/services/kibana-service:5601/proxy
  - name: SERVER_HOST
    value: "0.0.0.0"
</code></pre>

<p>What really solved is the SERVER_BASEPATH env.</p>
