forked from hswaw/hscloud
ops/monitoring: split up jsonnet, add simple docs
Change-Id: I8120958a6862411de0446896875766834457aba9
This commit is contained in:
parent
ce81c39081
commit
2022ac2338
4 changed files with 59 additions and 6 deletions
38
ops/monitoring/doc/index.md
Normal file
38
ops/monitoring/doc/index.md
Normal 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
11
ops/monitoring/k0.jsonnet
Normal file
|
@ -0,0 +1,11 @@
|
|||
local lib = import "lib.libsonnet";
|
||||
|
||||
{
|
||||
cluster: lib.Cluster("k0") {
|
||||
cfg+: {
|
||||
storageClasses+: {
|
||||
prometheus: "waw-hdd-redundant-3",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
5
ops/monitoring/lib.libsonnet
Normal file
5
ops/monitoring/lib.libsonnet
Normal file
|
@ -0,0 +1,5 @@
|
|||
local cluster = import "lib/cluster.libsonnet";
|
||||
|
||||
{
|
||||
Cluster: cluster.Cluster,
|
||||
}
|
|
@ -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"),
|
||||
}
|
Loading…
Reference in a new issue