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

Commit 06c7430

Browse files
committed
Use external kubernetes secret for elasticsearch credentials
1 parent e97bb3f commit 06c7430

File tree

3 files changed

+10
-28
lines changed

3 files changed

+10
-28
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,26 @@ spec:
2121
- name: ELASTICSEARCH_ADDRESS
2222
value: "http://elasticsearch-master.{{ .Release.Namespace }}.svc.cluster.local:9200"
2323
{{- end }}
24-
{{- if and .Values.authentication.user.username .Values.authentication.user.password }}
24+
{{- if .Values.authentication.userSecret }}
2525
- name: ELASTICSEARCH_USERNAME
2626
valueFrom:
2727
secretKeyRef:
28-
name: {{ include "persistence-elastic.fullname" . }}
28+
name: {{ .Values.authentication.userSecret }}
2929
key: username
3030
- name: ELASTICSEARCH_PASSWORD
3131
valueFrom:
3232
secretKeyRef:
33-
name: {{ include "persistence-elastic.fullname" . }}
33+
name: {{ .Values.authentication.userSecret }}
3434
key: password
3535
{{- else if and .Values.authentication.apiKey.id .Values.authentication.apiKey.key }}
3636
- name: ELASTICSEARCH_APIKEY_ID
3737
valueFrom:
3838
secretKeyRef:
39-
name: {{ include "persistence-elastic.fullname" . }}
39+
name: {{ .Values.authentication.apiKeySecret }}
4040
key: apiKey
4141
- name: ELASTICSEARCH_APIKEY
4242
valueFrom:
4343
secretKeyRef:
44-
name: {{ include "persistence-elastic.fullname" . }}
45-
key: apiKeyId
44+
name: {{ .Values.authentication.apiKeySecret }}
45+
key: id
4646
{{- end }}

persistence/persistence-elastic/templates/secret.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

persistence/persistence-elastic/values.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ externalElasticStack:
1919
# Configure authentication schema and credentials the persistence provider should use to connect to elasticsearch
2020
# user and apikey are mutually exclusive, only set one!
2121
authentication:
22-
user:
23-
username: null
24-
password: null
25-
apiKey:
26-
id: null
27-
key: null
22+
# Link a pre-existing generic secret with `username` and `password` key / value pairs
23+
userSecret: null
24+
# Link a pre-existing generic secret with `id` and `key` key / value pairs
25+
apiKeySecret: null
2826

2927
# Configures included Elasticsearch subchart
3028
elasticsearch:

0 commit comments

Comments
 (0)