Skip to content

Commit

Permalink
added kibana tls to es
Browse files Browse the repository at this point in the history
  • Loading branch information
AronKa-SAG committed Mar 21, 2024
1 parent 455b74c commit bb7fe4f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
7 changes: 7 additions & 0 deletions apigateway/helm/templates/_helper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ Build the secret name for kibana user
{{- default ( printf "%s%s" ( include "common.names.fullname" .) "-sag-user-kb" ) .Values.kibana.secretName }}
{{- end }}

{{/*
Build the secret password for truststore for Kibana
*/}}
{{- define "apigateway.kibanatruststorepassword" -}}
{{- default (printf "%s%s" ( include "common.names.fullname" .) "-truststore-password-kb") .Values.kibana.tls.truststorePasswordSecret }}
{{- end }}

{{/*
Build the secret name for keystore for Elasticsearch
*/}}
Expand Down
31 changes: 29 additions & 2 deletions apigateway/helm/templates/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ spec:
server.publicBaseUrl: https://{{ $defaultHost }}/apigatewayui/dashboardproxy
server.basePath: /apigatewayui/dashboardproxy
server.rewriteBasePath: false

{{- if .Values.kibana.tls.enabled }}
elasticsearch.ssl.truststore.path: /usr/share/kibana/config/elasticsearch-certs/truststore.p12
elasticsearch.ssl.truststore.password: "${KIBANA_TRUSTSTORE_PASSWORD}"
elasticsearch.ssl.verificationMode: {{ .Values.kibana.tls.verificationMode }}
{{- else }}
elasticsearch.ssl.verificationMode: none
{{- end }}
http:
tls:
selfSignedCertificate:
Expand Down Expand Up @@ -72,6 +78,15 @@ spec:
initContainers:
{{- toYaml .Values.kibana.extraInitContainers | nindent 8 }}
{{- end }}
{{- if .Values.kibana.tls.enabled }}
volumes:
- name: elasticsearch-certs
secret:
secretName: {{ .Values.kibana.tls.secretName }}
items:
- key: {{ .Values.kibana.tls.trustStoreName }}
path: truststore.p12
{{- end }}
containers:
- name: kibana
resources:
Expand All @@ -91,8 +106,20 @@ spec:
secretKeyRef:
name: {{ include "apigateway.kibanasecret" . }}
key: password
- name: KIBANA_TRUSTSTORE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "apigateway.kibanatruststorepassword" . }}
key: password
readinessProbe:
httpGet:
path: /status
port: 5601
scheme: HTTP
scheme: HTTP
{{- if .Values.kibana.tls.enabled }}
volumeMounts:
- name: elasticsearch-certs
mountPath: /usr/share/kibana/config/elasticsearch-certs/truststore.p12
subPath: truststore.p12
readOnly: true
{{- end }}
14 changes: 14 additions & 0 deletions apigateway/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,20 @@ kibana:
# Requires create=true to work.
roleName: ""

# -- Enable and configure tls connection from Kibana to Elasticsearch.
tls:
# -- Whether to enable tls connection from Kibana to Elasticsearch.
enabled: false
# -- Name of the k8s secret holding the p12 truststore for Kibana
secretName: ""
# -- File name of the p12 truststore for Kibana
trustStoreName: ""
# -- Name of the k8s secret containing the password for above p12 truststore in key 'password'
truststorePasswordSecret: dataport-truststore-p12-password
# -- TLS verification mode. Either 'none', 'certificate' or 'full'. Full includes hostname verification (service name must be in alt dns for it to work).
verificationMode: certificate


# -- Elasticsearch exporter settings. See https://github.com/prometheus-community/elasticsearch_exporter for details.
prometheus-elasticsearch-exporter:

Expand Down

0 comments on commit bb7fe4f

Please sign in to comment.