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", |
Sergiusz Bazanski | 2022ac2 | 2020-06-06 17:04:07 +0200 | [diff] [blame] | 12 | }, |
| 13 | }, |
Serge Bazanski | 363bf4f | 2020-08-24 21:00:56 +0200 | [diff] [blame] | 14 | |
| 15 | // Cluster tier - prometheus. |
| 16 | cluster: cluster.Cluster("k0") { |
| 17 | cfg+: cfg { |
| 18 | username: "cluster-k0", |
| 19 | upstreams: [ |
| 20 | { password: std.split(importstr "secrets/plain/global-agent-cluster-k0", "\n")[0], remote: k0.global.internalIngestURL }, |
| 21 | ], |
| 22 | }, |
| 23 | }, |
| 24 | |
| 25 | // Global tier - victoria metrics. |
| 26 | global: global.Global("k0") { |
| 27 | cfg+: cfg { |
| 28 | hosts: { |
| 29 | globalAPI: "monitoring-global-api.k0.hswaw.net", |
| 30 | }, |
| 31 | agents: [ |
| 32 | // Ingestion from k0 cluster tier. |
| 33 | { username: k0.cluster.cfg.username, password: std.split(importstr "secrets/plain/global-agent-cluster-k0", "\n")[0], }, |
| 34 | // Access from q3k's test Grafana. |
| 35 | { username: "grafana", password: std.split(importstr "secrets/plain/global-agent-grafana", "\n")[0], }, |
| 36 | ], |
| 37 | }, |
| 38 | }, |
Sergiusz Bazanski | 2022ac2 | 2020-06-06 17:04:07 +0200 | [diff] [blame] | 39 | } |