1
0
Fork 0

ops/monitoring: split up jsonnet, add simple docs

Change-Id: I8120958a6862411de0446896875766834457aba9
master
q3k 2020-06-06 17:04:07 +02:00
parent ce81c39081
commit 2022ac2338
4 changed files with 59 additions and 6 deletions

View File

@ -0,0 +1,38 @@
Monitoring
==========
Setting up monitoring in hscloud is a work in progress.
Components
----------
Currently we have a per-cluster setup with prometheus scraping Kubernetes nodes
(kubeletes) for kubelet metrics and cAdvisor metrics.
.-----------------------------------------------------------.
| k0.hswaw.net |
|-----------------------------------------------------------|
| .---------------------. |
| | ns: metrics-cluster | .--------------------------. |
| |---------------------| | kubernetes.svc.cluster | |
| | prometheus |--> | apiserver proxy to nodes | |
| '---------------------' '--------------------------' |
| | |
'---------------------------------------- v ----------------'
.---------------------.
| bc0n01.hswaw.net |-.
Kubernetes |---------------------| |-.
Nodes | /metrics |-| |
| /metrics/cadvisor | |-|
'---------------------' | |
'---------------------' |
'---------------------'
Everything else (dashboard, aggregation, user metrics) is a work in progress.
Legacy
------
There is a legacy prometheus/grafana VM on https://metrics.hackerspace.pl/. The
certificate is expired, but it Generally Works, and will be kept going until
its functionality is migrated to hscloud.

11
ops/monitoring/k0.jsonnet Normal file
View File

@ -0,0 +1,11 @@
local lib = import "lib.libsonnet";
{
cluster: lib.Cluster("k0") {
cfg+: {
storageClasses+: {
prometheus: "waw-hdd-redundant-3",
},
},
},
}

View File

@ -0,0 +1,5 @@
local cluster = import "lib/cluster.libsonnet";
{
Cluster: cluster.Cluster,
}

View File

@ -1,8 +1,9 @@
local kube = import "../../kube/kube.libsonnet";
local kube = import "../../../kube/kube.libsonnet";
{
local top = self,
// Per-cluster components
// Cluster sets up all cluster-specific monitoring resources in their own namespace.
// Currently this consists of a prometheus server that scrapes k8s nodes for kubelet
// and cAdvisor metrics.
Cluster(name):: {
local cluster = self,
local cfg = cluster.cfg,
@ -15,7 +16,7 @@ local kube = import "../../kube/kube.libsonnet";
},
storageClasses: {
prometheus: "waw-hdd-redundant-3",
prometheus: error "storageClasses.prometheus must be set",
},
},
@ -223,6 +224,4 @@ local kube = import "../../kube/kube.libsonnet";
},
},
},
k0: top.Cluster("k0"),
}