From b5e5609df9299ae9628bdc0e29cb636edfcf2654 Mon Sep 17 00:00:00 2001 From: Julien Mailleret <8582351+jmlrt@users.noreply.github.com> Date: Wed, 13 Oct 2021 15:56:18 +0200 Subject: [PATCH] [logstash] use new elasticsearch credentials (#1402) * [logstash] use new elasticsearch credentials This commit updates logstash values to use the new Elasticsearch credentials from #1384. Relates to #1375# * fixup! [logstash] use new elasticsearch credentials --- .../examples/elasticsearch/test/goss.yaml | 5 ++++- logstash/examples/elasticsearch/values.yaml | 21 ++++++++++++++++++- logstash/examples/security/values.yaml | 8 +++---- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/logstash/examples/elasticsearch/test/goss.yaml b/logstash/examples/elasticsearch/test/goss.yaml index 8dd73f80d..f52920d97 100644 --- a/logstash/examples/elasticsearch/test/goss.yaml +++ b/logstash/examples/elasticsearch/test/goss.yaml @@ -30,6 +30,8 @@ http: http://elasticsearch-master:9200/_cat/indices: status: 200 timeout: 2000 + username: "{{ .Env.ELASTICSEARCH_USERNAME }}" + password: "{{ .Env.ELASTICSEARCH_PASSWORD }}" body: - "logstash" @@ -51,4 +53,5 @@ file: filetype: file contains: - 'input { exec { command => "uptime" interval => 30 } }' - - 'output { elasticsearch { hosts => ["http://elasticsearch-master:9200"] index => "logstash" } }' + - 'hosts => ["http://elasticsearch-master:9200"]' + - 'index => "logstash"' diff --git a/logstash/examples/elasticsearch/values.yaml b/logstash/examples/elasticsearch/values.yaml index c51d1a4d1..bea22578c 100644 --- a/logstash/examples/elasticsearch/values.yaml +++ b/logstash/examples/elasticsearch/values.yaml @@ -9,4 +9,23 @@ logstashConfig: logstashPipeline: uptime.conf: | input { exec { command => "uptime" interval => 30 } } - output { elasticsearch { hosts => ["http://elasticsearch-master:9200"] index => "logstash" } } + output { + elasticsearch { + hosts => ["http://elasticsearch-master:9200"] + user => '${ELASTICSEARCH_USERNAME}' + password => '${ELASTICSEARCH_PASSWORD}' + index => "logstash" + } + } + +extraEnvs: + - name: "ELASTICSEARCH_USERNAME" + valueFrom: + secretKeyRef: + name: elasticsearch-master-credentials + key: username + - name: "ELASTICSEARCH_PASSWORD" + valueFrom: + secretKeyRef: + name: elasticsearch-master-credentials + key: password diff --git a/logstash/examples/security/values.yaml b/logstash/examples/security/values.yaml index 1457d7865..8dc78d423 100644 --- a/logstash/examples/security/values.yaml +++ b/logstash/examples/security/values.yaml @@ -28,13 +28,13 @@ secretMounts: path: /usr/share/logstash/config/certs extraEnvs: - - name: 'ELASTICSEARCH_USERNAME' + - name: "ELASTICSEARCH_USERNAME" valueFrom: secretKeyRef: - name: elastic-credentials + name: security-master-credentials key: username - - name: 'ELASTICSEARCH_PASSWORD' + - name: "ELASTICSEARCH_PASSWORD" valueFrom: secretKeyRef: - name: elastic-credentials + name: security-master-credentials key: password