# Exposing kibana with istio virtualservice need some extra steps

**URL:** <https://discuss.elastic.co/t/exposing-kibana-with-istio-virtualservice-need-some-extra-steps/185412>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [June 12, 2019, 12:26pm UTC](https://discuss.elastic.co/t/exposing-kibana-with-istio-virtualservice-need-some-extra-steps/185412 "2019-06-12T12:26:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamamd](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@mohamamd](https://discuss.elastic.co/u/mohamamd)\
**Post date:** [June 12, 2019, 12:26pm UTC](https://discuss.elastic.co/t/exposing-kibana-with-istio-virtualservice-need-some-extra-steps/185412/1 "2019-06-12T12:26:31Z")

</div>

I have deployed elasticsearch and Kibana using the ECK operator as explained in

[https://www.elastic.co/guide/en/cloud-on-k8s/current/index.html](https://www.elastic.co/guide/en/cloud-on-k8s/current/index.html)

When I port-forward to Kibana service everything works fine. But if I expose the service using Istio virtualservice I see the login page only but nothing works even I cannot login to Kibana.

The problem is when Kibana runs behind a proxy there is some problem with the base path. By default Kibana base path is " **/app/kibana**". So in my Kibana manifest, I tried to set the basepath as environment variable as below

```auto
apiVersion: kibana.k8s.elastic.co/v1alpha1
kind: Kibana
metadata:
 name: my-kibana
 namespace: elastic-system
spec:
 version: 7.1.0
 nodeCount: 2
 elasticsearchRef:
   name: myelasticsearch
 podTemplate:
   metadata:
     labels:
       app: my-kibana
   spec:
     containers:
     - name: kibana
       resources:
         limits:
           memory: 1Gi
           cpu: 1
       env:
       - name: SERVER_BASEPATH
         value: /

```

But it seems the "SERVER\_BASEPATH" env variable I tried to set in the pod template gets ignored by "Kibana" object.

My istio virtualservice is as below

```auto
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
 name: kibana
 namespace: elastic-system
spec:
 hosts:
 - "kibana.mydomain.com"
 gateways:
 - istio-system/https-gateway
 - istio-system/http-to-https-redirect
 http:
 #- match:
 # - uri:
 # prefix: "/app/kibana"
 # rewrite:
 # uri: "/"
 # route:
 # - destination:
 # host: my-kibana
 # port:
 # number: 5601
 - route:
   - destination:
       host: my-kibana
       port:
         number: 5601

```

Any idea how to expose Kibana using istio when ECK operator is used?

NOTE: Please ignore any kind name mismatch as i put custom name here and Kibana works completely fine when I do `kubectl portforward`

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [June 12, 2019, 6:43pm UTC](https://discuss.elastic.co/t/exposing-kibana-with-istio-virtualservice-need-some-extra-steps/185412/2 "2019-06-12T18:43:18Z")

</div>

Have you tried setting `server.basePath` in kibana.yml configuration? [https://www.elastic.co/guide/en/kibana/current/settings.html](https://www.elastic.co/guide/en/kibana/current/settings.html)

---

<div class="post-metadata">

**Author:** ![mohamamd](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@mohamamd](https://discuss.elastic.co/u/mohamamd)\
**Post date:** [June 13, 2019, 7:05am UTC](https://discuss.elastic.co/t/exposing-kibana-with-istio-virtualservice-need-some-extra-steps/185412/3 "2019-06-13T07:05:35Z")

</div>

Thank you for your reply.  
When I create a "Kibana" object, I am not sure how to pass a custom config file(kibana.yaml). I checked the kibana.yaml file though inside the pod. But if I manually update this file inside the pod this will not persist. That's why I was trying to set the "basepath" through environment variable in the kibana pod template. Unfortunately it seems they get ignored by the operator.

---

<div class="post-metadata">

**Author:** ![pebrc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pebrc/32/101790_2.png) [@pebrc](https://discuss.elastic.co/u/pebrc)\
**Post date:** [June 18, 2019, 12:22pm UTC](https://discuss.elastic.co/t/exposing-kibana-with-istio-virtualservice-need-some-extra-steps/185412/4 "2019-06-18T12:22:08Z")

</div>

In ECK 0.8.x only a subset of podTemplate attributes are applied namely: `labels`, `affinity` and `containers["kibana"].resources.limits`

This is fixed in [https://github.com/elastic/cloud-on-k8s/pull/952/](https://github.com/elastic/cloud-on-k8s/pull/952/)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 16, 2019, 12:22pm UTC](https://discuss.elastic.co/t/exposing-kibana-with-istio-virtualservice-need-some-extra-steps/185412/5 "2019-07-16T12:22:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
