From 76f71529046c6b9f58b8f57d2b5546913f01efdf Mon Sep 17 00:00:00 2001 From: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com> Date: Thu, 6 Jul 2023 13:11:55 -0500 Subject: [PATCH] Prometheus: [devenv] provision gdev-prometheus development environment with basic auth (#71153) * provision gdev-prometheus development environment with basic auth --- devenv/datasources.yaml | 4 ++++ devenv/docker/blocks/prometheus/Dockerfile | 1 + devenv/docker/blocks/prometheus/docker-compose.yaml | 1 + devenv/docker/blocks/prometheus/web.yml | 3 +++ 4 files changed, 9 insertions(+) create mode 100644 devenv/docker/blocks/prometheus/web.yml diff --git a/devenv/datasources.yaml b/devenv/datasources.yaml index 2f352935c23..1bfa72b9ea2 100644 --- a/devenv/datasources.yaml +++ b/devenv/datasources.yaml @@ -56,11 +56,15 @@ datasources: type: prometheus access: proxy url: http://localhost:9090 + basicAuth: true #username: admin, password: admin + basicAuthUser: admin jsonData: manageAlerts: true alertmanagerUid: gdev-alertmanager prometheusType: Prometheus #Cortex | Mimir | Prometheus | Thanos prometheusVersion: 2.40.0 + secureJsonData: + basicAuthPassword: admin #https://grafana.com/docs/grafana/latest/administration/provisioning/#using-environment-variables - name: gdev-slow-prometheus uid: gdev-slow-prometheus-uid diff --git a/devenv/docker/blocks/prometheus/Dockerfile b/devenv/docker/blocks/prometheus/Dockerfile index ea9fc071e3c..a39b100a950 100644 --- a/devenv/docker/blocks/prometheus/Dockerfile +++ b/devenv/docker/blocks/prometheus/Dockerfile @@ -2,3 +2,4 @@ FROM prom/prometheus:latest ADD prometheus.yml /etc/prometheus/ ADD recording.yml /etc/prometheus/ ADD alert.yml /etc/prometheus/ +ADD web.yml /etc/prometheus/ diff --git a/devenv/docker/blocks/prometheus/docker-compose.yaml b/devenv/docker/blocks/prometheus/docker-compose.yaml index 33dda81b14c..416064bd196 100644 --- a/devenv/docker/blocks/prometheus/docker-compose.yaml +++ b/devenv/docker/blocks/prometheus/docker-compose.yaml @@ -10,6 +10,7 @@ --storage.tsdb.path=/prometheus --web.console.libraries=/usr/share/prometheus/console_libraries --web.console.templates=/usr/share/prometheus/consoles + --web.config.file=/etc/prometheus/web.yml node_exporter: image: prom/node-exporter diff --git a/devenv/docker/blocks/prometheus/web.yml b/devenv/docker/blocks/prometheus/web.yml new file mode 100644 index 00000000000..bd98482e0f7 --- /dev/null +++ b/devenv/docker/blocks/prometheus/web.yml @@ -0,0 +1,3 @@ +basic_auth_users: + # username: admin, password: admin + admin: $2a$12$HvzPxejEHakuEIjxQ8uQrOaZ57GmFznB6M/w.85MpdEtSFFOOyDgW