Currently applying kibana ingress to non-root path fails.
Reason:
Kibana intially redirect to /login?next
Post successful authentication redirects to /app/kibana
Solution:
In order to solve this we need to configure the server.basePath, Operator is not providing any option to configure the same. Please plan to add it.
Related: https://github.com/elastic/cloud-on-k8s/issues/740
This is very high priority in our roadmap @kuldeeps88. Should be fixed for the next release.
Running into this as a road block in using the operator as well. I tried doing the following in the podTemplate which is how I made it work when using the Kibana image directly on Kubernetes without the operator:
podTemplate:
metadata:
labels:
app: kibana
function: logging
spec:
containers:
- name: kibana
env:
- name: SERVER_BASEPATH
value: /kibana
@djschny , it seems that env variables are not picked up by pod, eventhough you specify them in podTemplate.spec.env. Any idea if there should be another structure for injecting env or is this currently not supported?
This is fixed with https://github.com/elastic/cloud-on-k8s/pull/952.
Injecting environment variables is not supported in release 0.8, but will be in release 0.9 @BostjanBozic @djschny @kuldeeps88.
Thanks for reporting this!
@sebgl
With operator version 0.9 injecting environment variable is still not working.
`apiVersion: kibana.k8s.elastic.co/v1alpha1
kind: Kibana
metadata:
name: kibana
namespace: elastic-system
spec:
http:
tls:
selfSignedCertificate:
disabled: true
containers:
@kuldeeps88 this should be under the podTemplate.spec section of the Kibana spec:
`apiVersion: kibana.k8s.elastic.co/v1alpha1
kind: Kibana
metadata:
name: kibana
namespace: elastic-system
spec:
http:
tls:
selfSignedCertificate:
disabled: true
podTemplate:
spec:
containers:
- name: kibana
env:
- name: SERVER_BASEPATH
value: "/kibana"
version: 7.2.0
nodeCount: 1
elasticsearchRef:
name: elasticsearch-logging`
This one works for me with kibana operator, Thanks @sebgl
`apiVersion: kibana.k8s.elastic.co/v1alpha1
kind: Kibana
metadata:
name: kibana
namespace: elastic-system
spec:
http:
tls:
selfSignedCertificate:
disabled: true
podTemplate:
spec:
containers:
- name: kibana
env:
- name: SERVER_BASEPATH
value: "/kibana"
version: 7.2.0
nodeCount: 1
elasticsearchRef:
name: elasticsearch-logging`
ingress changes
`apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx-app
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^/kibana/(.*)$ /$1 break;
proxy_set_header Authorization "";
nginx.ingress.kubernetes.io/rewrite-target: /
generation: 1
labels:
groupid: DEFAULT
name: kibana-ingress
namespace: elastic-system
spec:
rules:
- host: %(HOSTNAME)s
http:
paths:
- backend:
serviceName: kibana-kb-http
servicePort: 5601
path: /kibana
tls:
- hosts:
- %(HOSTNAME)s
secretName: nginx-app-certs`
Most helpful comment
This one works for me with kibana operator, Thanks @sebgl
ingress changes