From f4dee34f44df142a6a446346047e2871bf751cac Mon Sep 17 00:00:00 2001 From: jmlrt <8582351+jmlrt@users.noreply.github.com> Date: Tue, 12 Oct 2021 13:37:11 +0200 Subject: [PATCH 1/2] [logstash] use new elasticsearch credentials This commit updates logstash values to use the new Elasticsearch credentials from #1384. Relates to #1375# --- .../examples/elasticsearch/test/goss.yaml | 2 ++ logstash/examples/elasticsearch/values.yaml | 21 ++++++++++++++++++- logstash/examples/security/values.yaml | 8 +++---- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/logstash/examples/elasticsearch/test/goss.yaml b/logstash/examples/elasticsearch/test/goss.yaml index 8dd73f80d..0573e3df9 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" 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 From 1688ba9885f800555e0f4fbf6ff76496819c5697 Mon Sep 17 00:00:00 2001 From: jmlrt <8582351+jmlrt@users.noreply.github.com> Date: Wed, 13 Oct 2021 14:54:24 +0200 Subject: [PATCH 2/2] fixup! [logstash] use new elasticsearch credentials --- logstash/examples/elasticsearch/test/goss.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/logstash/examples/elasticsearch/test/goss.yaml b/logstash/examples/elasticsearch/test/goss.yaml index 0573e3df9..f52920d97 100644 --- a/logstash/examples/elasticsearch/test/goss.yaml +++ b/logstash/examples/elasticsearch/test/goss.yaml @@ -53,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"'