Authentification before connecting in Kibana with Kubernetes and Ingress

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
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
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: basic
# name of the secret that contains the user/password definitions
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: 'Authentication Required - foo'
spec:
rules:

  • host: foo.bar.com
    http:
    paths:
    - path: /
    backend:
    serviceName: kibana-service
    servicePort: 5601

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.

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