feat: add top-5 fullest PVs panel to Kubernetes dashboard
Add a horizontal bar gauge showing the disk usage % of the 5 most-full
PersistentVolumes in the cluster, using kubelet volume stats already
scraped by Prometheus:
topk(5, kubelet_volume_stats_used_bytes
/ kubelet_volume_stats_capacity_bytes * 100)
Labels show namespace/PVC name. Color thresholds: green <70%, yellow
70–90%, red >90%. Placed at the bottom of the dashboard (y=46).
Bump dashboard version to 3.
This commit is contained in:
@@ -285,7 +285,7 @@ in
|
||||
"uid": "kubernetes-overview",
|
||||
"title": "Kubernetes Overview",
|
||||
"schemaVersion": 38,
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"refresh": "30s",
|
||||
"time": {"from": "now-3h", "to": "now"},
|
||||
"panels": [
|
||||
@@ -390,6 +390,41 @@ in
|
||||
"title": "Node Memory Usage %",
|
||||
"gridPos": {"x": 12, "y": 38, "w": 12, "h": 8},
|
||||
"targets": [{"datasource": {"type": "prometheus", "uid": "prometheus"}, "expr": "(1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) * 100", "refId": "A"}]
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"type": "bargauge",
|
||||
"title": "Top 5 Fullest PersistentVolumes",
|
||||
"gridPos": {"x": 0, "y": 46, "w": 24, "h": 8},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
||||
"expr": "topk(5, kubelet_volume_stats_used_bytes / kubelet_volume_stats_capacity_bytes * 100)",
|
||||
"legendFormat": "{{namespace}}/{{persistentvolumeclaim}}",
|
||||
"refId": "A",
|
||||
"instant": true
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"reduceOptions": {"calcs": ["lastNotNull"]},
|
||||
"orientation": "horizontal",
|
||||
"displayMode": "gradient"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "percent",
|
||||
"min": 0,
|
||||
"max": 100,
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{"color": "green", "value": null},
|
||||
{"color": "yellow", "value": 70},
|
||||
{"color": "red", "value": 90}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user