Serge Bazanski | 363bf4f | 2020-08-24 21:00:56 +0200 | [diff] [blame] | 1 | local cluster = import "lib/cluster.libsonnet"; |
| 2 | local global = import "lib/global.libsonnet"; |
| 3 | |
| 4 | // Monitoring tiers set up on k0. See README for architectural background. |
Sergiusz Bazanski | 2022ac2 | 2020-06-06 17:04:07 +0200 | [diff] [blame] | 5 | |
| 6 | { |
Serge Bazanski | 363bf4f | 2020-08-24 21:00:56 +0200 | [diff] [blame] | 7 | local k0 = self, |
| 8 | local cfg = { |
| 9 | storageClasses+: { |
| 10 | prometheus: "waw-hdd-redundant-3", |
| 11 | victoria: "waw-hdd-redundant-3", |
Serge Bazanski | 4f7caf8 | 2020-10-10 17:58:09 +0200 | [diff] [blame] | 12 | grafana: "waw-hdd-redundant-3", |
Sergiusz Bazanski | 2022ac2 | 2020-06-06 17:04:07 +0200 | [diff] [blame] | 13 | }, |
| 14 | }, |
Serge Bazanski | 363bf4f | 2020-08-24 21:00:56 +0200 | [diff] [blame] | 15 | |
| 16 | // Cluster tier - prometheus. |
| 17 | cluster: cluster.Cluster("k0") { |
| 18 | cfg+: cfg { |
| 19 | username: "cluster-k0", |
| 20 | upstreams: [ |
| 21 | { password: std.split(importstr "secrets/plain/global-agent-cluster-k0", "\n")[0], remote: k0.global.internalIngestURL }, |
| 22 | ], |
| 23 | }, |
| 24 | }, |
| 25 | |
| 26 | // Global tier - victoria metrics. |
| 27 | global: global.Global("k0") { |
| 28 | cfg+: cfg { |
Serge Bazanski | 4f7caf8 | 2020-10-10 17:58:09 +0200 | [diff] [blame] | 29 | oauth: { |
| 30 | clientId: "22659ba3-c8b2-4855-9553-f78884e0d743", |
| 31 | clientSecret: std.split(importstr "secrets/plain/global-oauth-client-secret", "\n")[0], |
| 32 | }, |
Serge Bazanski | 363bf4f | 2020-08-24 21:00:56 +0200 | [diff] [blame] | 33 | hosts: { |
| 34 | globalAPI: "monitoring-global-api.k0.hswaw.net", |
Serge Bazanski | 4f7caf8 | 2020-10-10 17:58:09 +0200 | [diff] [blame] | 35 | globalDashboard: "monitoring-global-dashboard.k0.hswaw.net", |
Serge Bazanski | 363bf4f | 2020-08-24 21:00:56 +0200 | [diff] [blame] | 36 | }, |
| 37 | agents: [ |
| 38 | // Ingestion from k0 cluster tier. |
| 39 | { username: k0.cluster.cfg.username, password: std.split(importstr "secrets/plain/global-agent-cluster-k0", "\n")[0], }, |
Serge Bazanski | 363bf4f | 2020-08-24 21:00:56 +0200 | [diff] [blame] | 40 | ], |
Serge Bazanski | 4f7caf8 | 2020-10-10 17:58:09 +0200 | [diff] [blame] | 41 | loopbackGrafanaUser: { |
| 42 | username: "grafana", |
| 43 | password: std.split(importstr "secrets/plain/global-agent-grafana", "\n")[0], |
| 44 | }, |
Serge Bazanski | 363bf4f | 2020-08-24 21:00:56 +0200 | [diff] [blame] | 45 | }, |
| 46 | }, |
Sergiusz Bazanski | 2022ac2 | 2020-06-06 17:04:07 +0200 | [diff] [blame] | 47 | } |