1
1
// Deploys a dashboard showing cluster-wide information
2
- local grafonnet = import " github.com/grafana/grafonnet/gen/grafonnet-v10.0.0/main.libsonnet" ;
2
+ local grafonnet = import ' github.com/grafana/grafonnet/gen/grafonnet-v10.0.0/main.libsonnet' ;
3
3
local dashboard = grafonnet.dashboard;
4
4
local ts = grafonnet.panel.timeSeries;
5
5
local prometheus = grafonnet.query.prometheus;
@@ -19,30 +19,30 @@ local variables = [
19
19
local userNodes = ts.new(
20
20
'Node Count'
21
21
) + ts.panelOptions.withDescription(
22
- " Number of nodes in each nodepool in this cluster"
22
+ ' Number of nodes in each nodepool in this cluster'
23
23
) + ts.standardOptions.withMin(
24
24
0
25
25
) + ts.queryOptions.withTargets([
26
- prometheus.new(
27
- '$PROMETHEUS_DS' ,
28
- |||
29
- # sum up all nodes by nodepool
30
- sum(
31
- # kube_pod_labels comes from
32
- # https://github.com/kubernetes/kube-state-metrics, and there is a particular
33
- # label (kubernetes_node) that lists the node on which the kube-state-metrics pod
34
- # s running! So that's totally irrelevant to these queries, but when a nodepool
35
- # is rotated it caused there to exist two metrics with the same node value (which
36
- # we care about) but different kubernetes_node values (because kube-state-metrics
37
- # was running in a different node, even though we don't care about that). This
38
- # group really just drops all labels except the two we care about to
39
- # avoid messing things up.
40
- group(
41
- kube_node_labels
42
- ) by (node, label_cloud_google_com_gke_nodepool)
43
- ) by (label_cloud_google_com_gke_nodepool)
44
- |||
45
- ) + prometheus.withLegendFormat('{{label_cloud_google_com_gke_nodepool}}' )
26
+ prometheus.new(
27
+ '$PROMETHEUS_DS' ,
28
+ |||
29
+ # sum up all nodes by nodepool
30
+ sum(
31
+ # kube_pod_labels comes from
32
+ # https://github.com/kubernetes/kube-state-metrics, and there is a particular
33
+ # label (kubernetes_node) that lists the node on which the kube-state-metrics pod
34
+ # s running! So that's totally irrelevant to these queries, but when a nodepool
35
+ # is rotated it caused there to exist two metrics with the same node value (which
36
+ # we care about) but different kubernetes_node values (because kube-state-metrics
37
+ # was running in a different node, even though we don't care about that). This
38
+ # group really just drops all labels except the two we care about to
39
+ # avoid messing things up.
40
+ group(
41
+ kube_node_labels
42
+ ) by (node, label_cloud_google_com_gke_nodepool)
43
+ ) by (label_cloud_google_com_gke_nodepool)
44
+ |||
45
+ ) + prometheus.withLegendFormat('{{label_cloud_google_com_gke_nodepool}}' ),
46
46
]);
47
47
48
48
local userPods = ts.new(
@@ -357,9 +357,9 @@ dashboard.new(
357
357
userPods,
358
358
// clusterMemoryCommitment,
359
359
// clusterCPUCommitment,
360
- userNodes
360
+ userNodes,
361
361
362
- ])
362
+ ]),
363
363
// nonRunningPods,
364
364
// row.new('Node Stats'),
365
365
// nodeCPUUtil,
0 commit comments