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
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
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
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