Skip to content

Commit e9f4f39

Browse files
committed
[jaeger] Simplify anonymous ES access by removing defaults from helper
Remove the `anonymous` flag and hardcoded default credentials from the elasticsearch.env helper. ES_USERNAME and ES_PASSWORD are now only injected when `storage.elasticsearch.user` and `storage.elasticsearch.password` are explicitly set. Omitting them gives anonymous access. Signed-off-by: Oliver Domokos <domolitom@gmail.com>
1 parent f5bb751 commit e9f4f39

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

charts/jaeger/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ storage:
114114
tls:
115115
enabled: false
116116
url: http://elasticsearch-master:9200
117-
anonymous: false # Set to true to skip injecting ES_USERNAME/ES_PASSWORD (e.g. for AWS OpenSearch with VPC-level access)
118117
# user: elastic
119118
# password: changeme
120119
```

charts/jaeger/templates/_helpers.tpl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,19 @@ Elasticsearch related environment variables
182182
{{- define "elasticsearch.env" -}}
183183
{{- if eq .Values.storage.type "elasticsearch" -}}
184184
{{- $es := .Values.storage.elasticsearch | default dict -}}
185-
{{- $user := $es.user | default "elastic" -}}
186-
{{- $password := $es.password | default "changeme" -}}
187-
{{- $url := $es.url | default "http://elasticsearch-master:9200" -}}
185+
{{- if $es.user }}
186+
- name: ES_USERNAME
187+
value: {{ $es.user | quote }}
188+
{{- end }}
189+
{{- if $es.password }}
190+
- name: ES_PASSWORD
191+
value: {{ $es.password | quote }}
192+
{{- end }}
193+
{{ $url := $es.url | default "http://elasticsearch-master:9200" -}}
188194
- name: ES_SERVER_URLS
189195
value: {{ $url | quote }}
190196
- name: ES_NODES
191197
value: {{ $url | quote }}
192-
{{- if not $es.anonymous }}
193-
- name: ES_USERNAME
194-
value: {{ $user | quote }}
195-
- name: ES_PASSWORD
196-
value: {{ $password | quote }}
197-
{{- end }}
198198
{{- /* Handle TLS insecurity */ -}}
199199
{{- if and (($es).tls).enabled (($es).tls).insecure }}
200200
- name: ES_TLS_SKIP_HOST_VERIFY

charts/jaeger/values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ storage:
268268
mountPath: ""
269269
subPath: ""
270270
url: http://elasticsearch-master:9200
271-
anonymous: false
272271
# user: elastic
273272
# password: changeme
274273

0 commit comments

Comments
 (0)