From f0ab10cc7eadf9ba253214532d9a2b62573c0dff Mon Sep 17 00:00:00 2001 From: David Calvert Date: Wed, 10 May 2023 09:17:24 +0200 Subject: [PATCH] feat: added pod status to k8s-views-{global,namespaces}.json Signed-off-by: David Calvert --- dashboards/k8s-views-global.json | 256 ++++++++++++++++++++++++--- dashboards/k8s-views-namespaces.json | 242 +++++++++++++++++++++++-- 2 files changed, 463 insertions(+), 35 deletions(-) diff --git a/dashboards/k8s-views-global.json b/dashboards/k8s-views-global.json index 5a7bff5..9f6466b 100644 --- a/dashboards/k8s-views-global.json +++ b/dashboards/k8s-views-global.json @@ -351,7 +351,6 @@ "custom": { "axisCenteredZero": false, "axisColorMode": "text", - "axisLabel": "NB", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", @@ -412,7 +411,9 @@ ], "displayMode": "table", "placement": "right", - "showLegend": true + "showLegend": true, + "sortBy": "Max", + "sortDesc": true }, "tooltip": { "mode": "multi", @@ -894,6 +895,220 @@ "title": "Running Pods", "type": "stat" }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 13 + }, + "id": 84, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kube_pod_status_qos_class) by (qos_class)", + "interval": "", + "legendFormat": "{{ qos_class }} pods", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_info)", + "hide": false, + "legendFormat": "Total pods", + "range": true, + "refId": "B" + } + ], + "title": "Kubernetes Pods QoS classes", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 13 + }, + "id": 85, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kube_pod_status_reason) by (reason)", + "interval": "", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Kubernetes Pods Status Reason", + "type": "timeseries" + }, { "collapsed": false, "datasource": { @@ -904,7 +1119,7 @@ "h": 1, "w": 24, "x": 0, - "y": 13 + "y": 22 }, "id": 71, "panels": [], @@ -982,7 +1197,7 @@ "h": 8, "w": 12, "x": 0, - "y": 14 + "y": 23 }, "id": 72, "options": { @@ -1080,7 +1295,7 @@ "h": 8, "w": 12, "x": 12, - "y": 14 + "y": 23 }, "id": 55, "options": { @@ -1185,7 +1400,7 @@ "h": 8, "w": 12, "x": 0, - "y": 22 + "y": 31 }, "id": 46, "options": { @@ -1236,7 +1451,6 @@ "custom": { "axisCenteredZero": false, "axisColorMode": "text", - "axisLabel": "MEMORY", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", @@ -1285,7 +1499,7 @@ "h": 8, "w": 12, "x": 12, - "y": 22 + "y": 31 }, "id": 50, "options": { @@ -1386,7 +1600,7 @@ "h": 8, "w": 12, "x": 0, - "y": 30 + "y": 39 }, "id": 54, "options": { @@ -1486,7 +1700,7 @@ "h": 8, "w": 12, "x": 12, - "y": 30 + "y": 39 }, "id": 73, "options": { @@ -1593,7 +1807,7 @@ "h": 8, "w": 12, "x": 0, - "y": 38 + "y": 47 }, "id": 82, "options": { @@ -1647,7 +1861,7 @@ "custom": { "axisCenteredZero": false, "axisColorMode": "text", - "axisLabel": "CPU CORES", + "axisLabel": "NB", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", @@ -1700,7 +1914,7 @@ "h": 8, "w": 12, "x": 12, - "y": 38 + "y": 47 }, "id": 83, "options": { @@ -1750,7 +1964,7 @@ "h": 1, "w": 24, "x": 0, - "y": 46 + "y": 55 }, "id": 69, "panels": [], @@ -1820,7 +2034,7 @@ "h": 8, "w": 12, "x": 0, - "y": 47 + "y": 56 }, "id": 44, "options": { @@ -1929,7 +2143,7 @@ "h": 8, "w": 12, "x": 12, - "y": 47 + "y": 56 }, "id": 53, "options": { @@ -2038,7 +2252,7 @@ "h": 8, "w": 12, "x": 0, - "y": 55 + "y": 64 }, "id": 79, "options": { @@ -2147,7 +2361,7 @@ "h": 8, "w": 12, "x": 12, - "y": 55 + "y": 64 }, "id": 80, "options": { @@ -2257,7 +2471,7 @@ "h": 8, "w": 12, "x": 0, - "y": 63 + "y": 72 }, "id": 56, "options": { @@ -2367,7 +2581,7 @@ "h": 8, "w": 12, "x": 12, - "y": 63 + "y": 72 }, "id": 81, "options": { @@ -2499,6 +2713,6 @@ "timezone": "", "title": "Kubernetes / Views / Global", "uid": "k8s_views_global", - "version": 25, + "version": 26, "weekStart": "" } diff --git a/dashboards/k8s-views-namespaces.json b/dashboards/k8s-views-namespaces.json index 040f243..915682a 100644 --- a/dashboards/k8s-views-namespaces.json +++ b/dashboards/k8s-views-namespaces.json @@ -620,6 +620,220 @@ "title": "Namespace(s) RAM Usage in bytes", "type": "stat" }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 12 + }, + "id": 70, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kube_pod_status_qos_class{namespace=~\"$namespace\"}) by (qos_class)", + "interval": "", + "legendFormat": "{{ qos_class }} pods", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(kube_pod_info{namespace=~\"$namespace\"})", + "hide": false, + "legendFormat": "Total pods", + "range": true, + "refId": "B" + } + ], + "title": "Kubernetes Pods QoS classes", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 12 + }, + "id": 72, + "options": { + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(kube_pod_status_reason) by (reason)", + "interval": "", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Kubernetes Pods Status Reason", + "type": "timeseries" + }, { "collapsed": false, "datasource": { @@ -630,7 +844,7 @@ "h": 1, "w": 24, "x": 0, - "y": 12 + "y": 21 }, "id": 40, "panels": [], @@ -699,7 +913,7 @@ "h": 8, "w": 12, "x": 0, - "y": 13 + "y": 22 }, "id": 29, "options": { @@ -795,7 +1009,7 @@ "h": 8, "w": 12, "x": 12, - "y": 13 + "y": 22 }, "id": 30, "options": { @@ -894,7 +1108,7 @@ "h": 8, "w": 12, "x": 0, - "y": 21 + "y": 30 }, "id": 68, "options": { @@ -944,7 +1158,7 @@ "h": 1, "w": 24, "x": 0, - "y": 29 + "y": 38 }, "id": 44, "panels": [], @@ -1014,7 +1228,7 @@ "h": 8, "w": 12, "x": 0, - "y": 30 + "y": 39 }, "id": 5, "options": { @@ -1148,7 +1362,7 @@ "h": 8, "w": 12, "x": 12, - "y": 30 + "y": 39 }, "id": 2, "options": { @@ -1241,7 +1455,7 @@ "h": 8, "w": 12, "x": 0, - "y": 38 + "y": 47 }, "id": 7, "options": { @@ -1335,7 +1549,7 @@ "h": 8, "w": 12, "x": 12, - "y": 38 + "y": 47 }, "id": 8, "options": { @@ -1376,7 +1590,7 @@ "h": 1, "w": 24, "x": 0, - "y": 46 + "y": 55 }, "id": 42, "panels": [], @@ -1446,7 +1660,7 @@ "h": 8, "w": 12, "x": 0, - "y": 47 + "y": 56 }, "id": 65, "options": { @@ -1541,7 +1755,7 @@ "h": 8, "w": 12, "x": 12, - "y": 47 + "y": 56 }, "id": 66, "options": { @@ -1648,7 +1862,7 @@ "h": 8, "w": 12, "x": 0, - "y": 55 + "y": 64 }, "id": 27, "options": { @@ -1798,6 +2012,6 @@ "timezone": "", "title": "Kubernetes / Views / Namespaces", "uid": "k8s_views_ns", - "version": 19, + "version": 20, "weekStart": "" }