From 9cae8c8fc2fc3486edb80a135ecfed02fb6840a3 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 4 May 2022 16:27:46 +0200 Subject: Update telemetry to ES 8.2.0 and simplify config a bit --- app/telemetry/config/apm-config.yaml | 4 +- .../grafana/provisioning/datasources/elastic.yaml | 8 ++-- app/telemetry/deploy/telemetry-system.hcl | 18 ++++++--- app/telemetry/deploy/telemetry.hcl | 2 +- doc/telemetry.md | 44 +++++----------------- 5 files changed, 30 insertions(+), 46 deletions(-) diff --git a/app/telemetry/config/apm-config.yaml b/app/telemetry/config/apm-config.yaml index 9288036..07a88bd 100644 --- a/app/telemetry/config/apm-config.yaml +++ b/app/telemetry/config/apm-config.yaml @@ -8,8 +8,8 @@ output.elasticsearch: # In case you specify and additional path, the scheme is required: `http://localhost:9200/path`. # IPv6 addresses should always be defined as: `https://[2001:db8::1]:9200`. hosts: ["localhost:9200"] - username: "apm" - password: "{{ key "secrets/telemetry/elastic_passwords/apm" }}" + username: "elastic" + password: "{{ key "secrets/telemetry/elastic_passwords/elastic" }}" instrumentation: enabled: true diff --git a/app/telemetry/config/grafana/provisioning/datasources/elastic.yaml b/app/telemetry/config/grafana/provisioning/datasources/elastic.yaml index a41be6f..7d2277c 100644 --- a/app/telemetry/config/grafana/provisioning/datasources/elastic.yaml +++ b/app/telemetry/config/grafana/provisioning/datasources/elastic.yaml @@ -5,13 +5,13 @@ datasources: type: elasticsearch access: proxy url: http://localhost:9200 - password: '{{ key "secrets/telemetry/elastic_passwords/grafana" }}' - user: 'grafana' - database: apm-* + password: '{{ key "secrets/telemetry/elastic_passwords/elastic" }}' + user: 'elastic' + database: metrics-* basicAuth: false isDefault: true jsonData: - esVersion: "7.10.0" + esVersion: "8.2.0" includeFrozen: false logLevelField: '' logMessageField: '' diff --git a/app/telemetry/deploy/telemetry-system.hcl b/app/telemetry/deploy/telemetry-system.hcl index cb39bac..d5a7241 100644 --- a/app/telemetry/deploy/telemetry-system.hcl +++ b/app/telemetry/deploy/telemetry-system.hcl @@ -15,10 +15,11 @@ job "telemetry-system" { task "elastic" { driver = "docker" config { - image = "docker.elastic.co/elasticsearch/elasticsearch:7.17.0" + image = "docker.elastic.co/elasticsearch/elasticsearch:8.2.0" network_mode = "host" volumes = [ "/mnt/ssd/telemetry/es_data:/usr/share/elasticsearch/data", + "secrets/elastic-certificates.p12:/usr/share/elasticsearch/config/elastic-certificates.p12", ] ports = [ "elastic", "elastic_internal" ] sysctl = { @@ -29,11 +30,18 @@ job "telemetry-system" { } } + user = "1000" + resources { memory = 1500 cpu = 500 } + template { + data = "{{ key \"secrets/telemetry/elasticsearch/elastic-certificates.p12\" }}" + destination = "secrets/elastic-certificates.p12" + } + template { data = <