Hi, everyone:
I would like to know how to configure HTTPS in Kibana on Kubernetes. I have created my own certificate with OpenSSL:
openssl req -x509 -newkey rsa:2048 -nodes -keyout /home/{{my_user}}/main-certs/main.key -out /home/{{my_user}}/main-certs/main.crt -days 365 -subj /C=ES/ST=Spain/L=Madrid/O=Entreprise/OU=IT/CN={{kubernetes-master}}
kibana.yml
server.ssl.enabled: true
server.ssl.key: /usr/share/kibana/https/main.key
server.ssl.certificate: /usr/share/kibana/https/main.crt
I have a issue related to this when I deploy Kibana:
{"type":"error","@timestamp":"2019-04-02T09:32:44Z","tags":["connection","client","error"],"pid":1,"level":"error","error":{"message":"139651378964352:error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate:../deps/openssl/openssl/ssl/s3_pkt.c:1498:SSL alert number 42\n","name":"Error","stack":"Error: 139651378964352:error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate:../deps/openssl/openssl/ssl/s3_pkt.c:1498:SSL alert number 42\n"},"message":"139651378964352:error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate:../deps/openssl/openssl/ssl/s3_pkt.c:1498:SSL alert number 42\n"}
StatefulSet
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: kibana
labels:
k8s-app: kibana
spec:
serviceName: kibana
replicas: 1
selector:
matchLabels:
k8s-app: kibana
template:
metadata:
labels:
k8s-app: kibana
spec:
containers:
- name: kibana
image: docker.elastic.co/kibana/kibana:6.5.4
ports:
- name: http
containerPort: 5601
volumeMounts:
- name: https
mountPath: /usr/share/kibana/https
- name: config
mountPath: /usr/share/kibana/config/kibana.yml
subPath: kibana.yml
volumes:
- name: https
secret:
secretName: main-tls-secret
- name: config
configMap:
name: kibana-config
Service
apiVersion: v1
kind: Service
metadata:
name: kibana
labels:
k8s-app: kibana
spec:
type: NodePort
ports:
- name: http
port: 5601
nodePort: 30100
selector:
k8s-app: kibana
Thanks in advance,
Regards