# Authentification before connecting in Kibana with Kubernetes and Ingress

**URL:** <https://discuss.elastic.co/t/authentification-before-connecting-in-kibana-with-kubernetes-and-ingress/178631>\
**Category:** Kibana\
**Created:** [April 26, 2019, 11:17am UTC](https://discuss.elastic.co/t/authentification-before-connecting-in-kibana-with-kubernetes-and-ingress/178631 "2019-04-26T11:17:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lydia\_Khalfoun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lydia_khalfoun/32/45091_2.png) [@Lydia\_Khalfoun](https://discuss.elastic.co/u/Lydia_Khalfoun)\
**Post date:** [April 26, 2019, 11:17am UTC](https://discuss.elastic.co/t/authentification-before-connecting-in-kibana-with-kubernetes-and-ingress/178631/1 "2019-04-26T11:17:05Z")

</div>

Hi,

I had a kubernetes cluster with kibana and Elasticsearch. It works well. Now I want to add an authentification with Ingress (user/password). I want results like this link : [https://blog.bigbinary.com/2018/08/14/using-kubernetes-ingress-authentication.html](https://blog.bigbinary.com/2018/08/14/using-kubernetes-ingress-authentication.html)  
The url server was not found when I want to connect with my Ingress URL.

I try to modify the env variable server basename in kibana.yaml but no success

Here my kibana.yaml :

> apiVersion: apps/v1beta1  
> kind: Deployment  
> metadata:  
> name: kibana  
> 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-oss:6.3.2](http://docker.elastic.co/kibana/kibana-oss:6.3.2)  
> env:  
> - name: CLUSTER\_NAME  
> value: myesdb  
> # name: SERVER\_BASEPATH  
> #value: /kibana.internal.carlosedp.com  
> #value: /kibana  
> #value: /api/v1/namespaces/default/services/kibana:http/proxy  
> resources:  
> limits:  
> cpu: 1000m  
> requests:  
> cpu: 100m  
> ports:  
> - containerPort: 5601  
> name: http  
> readinessProbe:  
> httpGet:  
> path: /api/status  
> port: http  
> initialDelaySeconds: 20  
> timeoutSeconds: 5  
> volumeMounts:  
> - name: config  
> mountPath: /usr/share/kibana/config  
> readOnly: true  
> volumes:  
> - name: config  
> configMap:  
> name: kibana-config

Here my ingress.yaml

> apiVersion: extensions/v1beta1  
> kind: Ingress  
> metadata:  
> name: ingress-with-auth  
> annotations:  
> # type of authentication  
> [nginx.ingress.kubernetes.io/auth-type:](http://nginx.ingress.kubernetes.io/auth-type:) basic  
> # name of the secret that contains the user/password definitions  
> [nginx.ingress.kubernetes.io/auth-secret:](http://nginx.ingress.kubernetes.io/auth-secret:) mypasswd  
> # message to display with an appropriate context why the authentication is required  
> [nginx.ingress.kubernetes.io/auth-realm:](http://nginx.ingress.kubernetes.io/auth-realm:) 'Authentication Required - foo'  
> spec:  
> rules:
> 
> - host: [foo.bar.com](http://foo.bar.com)  
> http:  
> paths:  
> - path: /  
> backend:  
> serviceName: kibana-service  
> servicePort: 5601

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [April 26, 2019, 4:24pm UTC](https://discuss.elastic.co/t/authentification-before-connecting-in-kibana-with-kubernetes-and-ingress/178631/2 "2019-04-26T16:24:29Z")

</div>

Hey @Lydia_Khalfoun, if I understand correctly, you're trying to enforce authentication using k8s ingress controller, which doesn't rely on any of the security features that are built in to Kibana/Elasticsearch. You'll likely get better assistance posting this question in a k8s specific forum or stack overflow.

---

<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:** [May 24, 2019, 4:24pm UTC](https://discuss.elastic.co/t/authentification-before-connecting-in-kibana-with-kubernetes-and-ingress/178631/3 "2019-05-24T16:24:35Z")

</div>

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