Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 8259cf1

Browse files
committed
Add option to add an external elasticsearch url and configure authentication via helm
1 parent db81a08 commit 8259cf1

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed

persistence/persistence-elastic/templates/import-dashboard.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,10 @@ spec:
1313
image: scbexperimental/persistence-elastic-dashboard-importer
1414
imagePullPolicy: Always
1515
env:
16+
{{- if .Values.externalElasticStack.enabled }}
1617
- name: KIBANA_URL
17-
value: "http://persistence-elastic-kibana.{{ .Release.Namespace }}.svc.cluster.local:5601"
18+
value: {{ .Values.externalElasticStack.kibanaAddress | quote }}
19+
{{- else }}
20+
- name: KIBANA_URL
21+
value: "http://persistence-elastic-kibana.{{ .Release.Namespace }}.svc.cluster.local:5601"
22+
{{- end }}

persistence/persistence-elastic/templates/persistence-provider.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,21 @@ metadata:
77
spec:
88
image: "scbexperimental/persistence-elastic:latest"
99
env:
10+
{{- if .Values.externalElasticStack.enabled }}
11+
- name: ELASTICSEARCH_ADDRESS
12+
value: {{ .Values.externalElasticStack.elasticsearchAddress | quote }}
13+
{{- else }}
1014
- name: ELASTICSEARCH_ADDRESS
1115
value: "http://elasticsearch-master.{{ .Release.Namespace }}.svc.cluster.local:9200"
16+
{{- end }}
17+
{{- if and .Values.authentication.user.username .Values.authentication.user.password }}
18+
- name: ELASTICSEARCH_USERNAME
19+
value: {{ .Values.authentication.user.username | quote }}
20+
- name: ELASTICSEARCH_PASSWORD
21+
value: {{ .Values.authentication.user.password | quote }}
22+
{{- else if .Values.authentication.apikey.key }}
23+
- name: ELASTICSEARCH_APIKEY_ID
24+
value: {{ .Values.authentication.apikey.id | quote }}
25+
- name: ELASTICSEARCH_APIKEY
26+
value: {{ .Values.authentication.apikey.key | quote }}
27+
{{- end }}

persistence/persistence-elastic/values.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ image:
66
repository: scbexperimental/persistence-elastic
77
pullPolicy: Always
88

9+
# Enable this when you already have an Elastic Stack running to which you want to send your results
10+
externalElasticStack:
11+
enabled: false
12+
elasticsearchAddress: "https://elasticsearch.example.com"
13+
kibanaAddress: "https://kibana.example.com"
14+
15+
# Configure authentication schema and credentials the persistence provider should use to connect to elasticsearch
16+
# user and apikey are mutually exclusive, only set one!
17+
authentication:
18+
user:
19+
username: null
20+
password: null
21+
apikey:
22+
# Todo(@J12934) figure out when the "id" field is required for api keys.
23+
key: null
24+
925
elasticsearch:
1026
enabled: true
1127
replicas: 1
@@ -17,8 +33,8 @@ kibana:
1733
# image: docker.elastic.co/kibana/kibana-oss
1834

1935
imagePullSecrets: []
20-
nameOverride: ''
21-
fullnameOverride: ''
36+
nameOverride: ""
37+
fullnameOverride: ""
2238

2339
podSecurityContext:
2440
{}

0 commit comments

Comments
 (0)