Skip to content

Instantly share code, notes, and snippets.

@ebuildy
Created June 26, 2023 20:39
Show Gist options
  • Save ebuildy/b4bdb5238a862f9efd04b5596f48aa55 to your computer and use it in GitHub Desktop.
Save ebuildy/b4bdb5238a862f9efd04b5596f48aa55 to your computer and use it in GitHub Desktop.

Revisions

  1. ebuildy created this gist Jun 26, 2023.
    1,531 changes: 1,531 additions & 0 deletions k8s_node_capacity_dashboard.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,1531 @@
    {
    "annotations": {
    "list": [
    {
    "builtIn": 1,
    "datasource": {
    "type": "grafana",
    "uid": "-- Grafana --"
    },
    "enable": true,
    "hide": true,
    "iconColor": "rgba(0, 211, 255, 1)",
    "name": "Annotations & Alerts",
    "target": {
    "limit": 100,
    "matchAny": false,
    "tags": [],
    "type": "dashboard"
    },
    "type": "dashboard"
    }
    ]
    },
    "editable": true,
    "fiscalYearStartMonth": 0,
    "graphTooltip": 0,
    "id": 268,
    "links": [],
    "liveNow": false,
    "panels": [
    {
    "collapsed": true,
    "gridPos": {
    "h": 1,
    "w": 24,
    "x": 0,
    "y": 0
    },
    "id": 17,
    "panels": [
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "description": "",
    "fieldConfig": {
    "defaults": {
    "color": {
    "mode": "thresholds"
    },
    "custom": {
    "align": "auto",
    "displayMode": "auto",
    "inspect": false
    },
    "mappings": [],
    "thresholds": {
    "mode": "absolute",
    "steps": [
    {
    "color": "green",
    "value": null
    }
    ]
    },
    "unit": "bytes"
    },
    "overrides": [
    {
    "matcher": {
    "id": "byName",
    "options": "capacity"
    },
    "properties": [
    {
    "id": "color",
    "value": {
    "fixedColor": "#73BF69",
    "mode": "fixed"
    }
    }
    ]
    },
    {
    "matcher": {
    "id": "byName",
    "options": "requests"
    },
    "properties": [
    {
    "id": "color",
    "value": {
    "fixedColor": "#73BF69",
    "mode": "fixed"
    }
    }
    ]
    },
    {
    "matcher": {
    "id": "byRegexp",
    "options": "^(.*)\\%$"
    },
    "properties": [
    {
    "id": "unit",
    "value": "percentunit"
    },
    {
    "id": "color",
    "value": {
    "mode": "continuous-GrYlRd"
    }
    },
    {
    "id": "thresholds",
    "value": {
    "mode": "absolute",
    "steps": [
    {
    "color": "green",
    "value": null
    },
    {
    "color": "red",
    "value": 0.5
    }
    ]
    }
    }
    ]
    },
    {
    "matcher": {
    "id": "byName",
    "options": "node"
    },
    "properties": [
    {
    "id": "custom.width",
    "value": 259
    }
    ]
    },
    {
    "matcher": {
    "id": "byName",
    "options": "capacity disks"
    },
    "properties": [
    {
    "id": "unit",
    "value": "none"
    }
    ]
    }
    ]
    },
    "gridPos": {
    "h": 12,
    "w": 24,
    "x": 0,
    "y": 1
    },
    "id": 18,
    "options": {
    "footer": {
    "fields": "",
    "reducer": [
    "sum"
    ],
    "show": false
    },
    "showHeader": true,
    "sortBy": []
    },
    "pluginVersion": "9.1.5",
    "targets": [
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_node_status_capacity{resource=\"ephemeral_storage\"}",
    "format": "table",
    "hide": false,
    "instant": true,
    "legendFormat": "{{node}}",
    "range": false,
    "refId": "B"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_node_status_capacity{resource=\"attachable_volumes_azure_disk\"}",
    "format": "table",
    "hide": false,
    "instant": true,
    "legendFormat": "__auto",
    "range": false,
    "refId": "D"
    }
    ],
    "title": "Pod disk by node",
    "transformations": [
    {
    "id": "groupBy",
    "options": {
    "fields": {
    "Value #B": {
    "aggregations": [
    "lastNotNull"
    ],
    "operation": "aggregate"
    },
    "Value #C": {
    "aggregations": [
    "lastNotNull"
    ],
    "operation": "aggregate"
    },
    "Value #D": {
    "aggregations": [
    "lastNotNull"
    ],
    "operation": "aggregate"
    },
    "node": {
    "aggregations": [],
    "operation": "groupby"
    }
    }
    }
    },
    {
    "id": "seriesToColumns",
    "options": {
    "byField": "node"
    }
    },
    {
    "id": "organize",
    "options": {
    "excludeByName": {},
    "indexByName": {},
    "renameByName": {
    "Value #A (sum)": "requests",
    "Value #B (lastNotNull)": "capacity size",
    "Value #C (sum)": "limits",
    "Value #D (lastNotNull)": "capacity disks",
    "node": "node"
    }
    }
    }
    ],
    "type": "table"
    }
    ],
    "title": "Disk",
    "type": "row"
    },
    {
    "collapsed": true,
    "gridPos": {
    "h": 1,
    "w": 24,
    "x": 0,
    "y": 1
    },
    "id": 9,
    "panels": [
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "description": "",
    "fieldConfig": {
    "defaults": {
    "color": {
    "mode": "thresholds"
    },
    "custom": {
    "align": "auto",
    "displayMode": "auto",
    "inspect": false
    },
    "mappings": [],
    "thresholds": {
    "mode": "absolute",
    "steps": [
    {
    "color": "green",
    "value": null
    }
    ]
    },
    "unit": "bytes"
    },
    "overrides": [
    {
    "matcher": {
    "id": "byName",
    "options": "capacity"
    },
    "properties": [
    {
    "id": "color",
    "value": {
    "fixedColor": "#73BF69",
    "mode": "fixed"
    }
    }
    ]
    },
    {
    "matcher": {
    "id": "byName",
    "options": "requests"
    },
    "properties": [
    {
    "id": "color",
    "value": {
    "fixedColor": "#73BF69",
    "mode": "fixed"
    }
    }
    ]
    },
    {
    "matcher": {
    "id": "byRegexp",
    "options": "^(.*)\\%$"
    },
    "properties": [
    {
    "id": "unit",
    "value": "percentunit"
    },
    {
    "id": "color",
    "value": {
    "mode": "continuous-GrYlRd"
    }
    },
    {
    "id": "thresholds",
    "value": {
    "mode": "absolute",
    "steps": [
    {
    "color": "green",
    "value": null
    },
    {
    "color": "red",
    "value": 0.5
    }
    ]
    }
    }
    ]
    },
    {
    "matcher": {
    "id": "byName",
    "options": "node"
    },
    "properties": [
    {
    "id": "custom.width",
    "value": 259
    }
    ]
    }
    ]
    },
    "gridPos": {
    "h": 12,
    "w": 24,
    "x": 0,
    "y": 2
    },
    "id": 5,
    "options": {
    "footer": {
    "fields": "",
    "reducer": [
    "sum"
    ],
    "show": false
    },
    "showHeader": true,
    "sortBy": []
    },
    "pluginVersion": "9.1.5",
    "targets": [
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_pod_container_resource_requests{resource=\"memory\"}",
    "format": "table",
    "instant": true,
    "legendFormat": "{{node}}",
    "range": false,
    "refId": "A"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_pod_container_resource_limits{resource=\"memory\"}",
    "format": "table",
    "hide": false,
    "instant": true,
    "legendFormat": "{{node}}",
    "range": false,
    "refId": "C"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_node_status_capacity{resource=\"memory\"}",
    "format": "table",
    "hide": false,
    "instant": true,
    "legendFormat": "{{node}}",
    "range": false,
    "refId": "B"
    }
    ],
    "title": "Pod memory request by node",
    "transformations": [
    {
    "id": "groupBy",
    "options": {
    "fields": {
    "Value": {
    "aggregations": [
    "sum"
    ],
    "operation": "aggregate"
    },
    "Value #A": {
    "aggregations": [
    "sum"
    ],
    "operation": "aggregate"
    },
    "Value #B": {
    "aggregations": [
    "lastNotNull"
    ],
    "operation": "aggregate"
    },
    "Value #C": {
    "aggregations": [
    "sum"
    ],
    "operation": "aggregate"
    },
    "node": {
    "aggregations": [],
    "operation": "groupby"
    }
    }
    }
    },
    {
    "id": "seriesToColumns",
    "options": {
    "byField": "node"
    }
    },
    {
    "id": "organize",
    "options": {
    "excludeByName": {},
    "indexByName": {},
    "renameByName": {
    "Value #A (sum)": "requests",
    "Value #B (lastNotNull)": "capacity",
    "Value #C (sum)": "limits",
    "node": "node"
    }
    }
    },
    {
    "id": "calculateField",
    "options": {
    "alias": "requests %",
    "binary": {
    "left": "requests",
    "operator": "/",
    "reducer": "sum",
    "right": "capacity"
    },
    "mode": "binary",
    "reduce": {
    "reducer": "diffperc"
    }
    }
    },
    {
    "id": "calculateField",
    "options": {
    "alias": "limits %",
    "binary": {
    "left": "limits",
    "operator": "/",
    "reducer": "sum",
    "right": "capacity"
    },
    "mode": "binary",
    "reduce": {
    "reducer": "sum"
    }
    }
    },
    {
    "id": "organize",
    "options": {
    "excludeByName": {},
    "indexByName": {
    "capacity": 5,
    "limits": 3,
    "limits %": 4,
    "node": 0,
    "requests": 1,
    "requests %": 2
    },
    "renameByName": {}
    }
    }
    ],
    "type": "table"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "description": "",
    "fieldConfig": {
    "defaults": {
    "color": {
    "mode": "thresholds"
    },
    "custom": {
    "axisCenteredZero": false,
    "axisColorMode": "text",
    "axisLabel": "",
    "axisPlacement": "auto",
    "fillOpacity": 80,
    "gradientMode": "none",
    "hideFrom": {
    "legend": false,
    "tooltip": false,
    "viz": false
    },
    "lineWidth": 1,
    "scaleDistribution": {
    "type": "linear"
    }
    },
    "mappings": [],
    "thresholds": {
    "mode": "absolute",
    "steps": [
    {
    "color": "green",
    "value": null
    }
    ]
    },
    "unit": "bytes"
    },
    "overrides": [
    {
    "matcher": {
    "id": "byName",
    "options": "capacity"
    },
    "properties": [
    {
    "id": "custom.axisPlacement",
    "value": "right"
    },
    {
    "id": "custom.lineWidth",
    "value": 0
    },
    {
    "id": "custom.axisWidth"
    },
    {
    "id": "color",
    "value": {
    "fixedColor": "#73BF69",
    "mode": "fixed"
    }
    }
    ]
    },
    {
    "matcher": {
    "id": "byName",
    "options": "requests"
    },
    "properties": [
    {
    "id": "color",
    "value": {
    "fixedColor": "#73BF69",
    "mode": "fixed"
    }
    }
    ]
    }
    ]
    },
    "gridPos": {
    "h": 14,
    "w": 12,
    "x": 0,
    "y": 14
    },
    "id": 4,
    "options": {
    "barRadius": 0,
    "barWidth": 0.97,
    "groupWidth": 0.7,
    "legend": {
    "calcs": [],
    "displayMode": "list",
    "placement": "bottom",
    "showLegend": true
    },
    "orientation": "horizontal",
    "showValue": "auto",
    "stacking": "none",
    "tooltip": {
    "mode": "single",
    "sort": "none"
    },
    "xTickLabelRotation": 0,
    "xTickLabelSpacing": 0
    },
    "pluginVersion": "9.1.5",
    "targets": [
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_pod_container_resource_requests{resource=\"memory\"}",
    "format": "table",
    "instant": true,
    "legendFormat": "{{node}}",
    "range": false,
    "refId": "A"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_pod_container_resource_limits{resource=\"memory\"}",
    "format": "table",
    "hide": false,
    "instant": true,
    "legendFormat": "{{node}}",
    "range": false,
    "refId": "C"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_node_status_capacity{resource=\"memory\"}",
    "format": "table",
    "hide": false,
    "instant": true,
    "legendFormat": "{{node}}",
    "range": false,
    "refId": "B"
    }
    ],
    "title": "Pod memory request by node",
    "transformations": [
    {
    "id": "groupBy",
    "options": {
    "fields": {
    "Value": {
    "aggregations": [
    "sum"
    ],
    "operation": "aggregate"
    },
    "Value #A": {
    "aggregations": [
    "sum"
    ],
    "operation": "aggregate"
    },
    "Value #B": {
    "aggregations": [
    "lastNotNull"
    ],
    "operation": "aggregate"
    },
    "Value #C": {
    "aggregations": [
    "sum"
    ],
    "operation": "aggregate"
    },
    "node": {
    "aggregations": [],
    "operation": "groupby"
    }
    }
    }
    },
    {
    "id": "seriesToColumns",
    "options": {
    "byField": "node"
    }
    },
    {
    "id": "organize",
    "options": {
    "excludeByName": {},
    "indexByName": {},
    "renameByName": {
    "Value #A (sum)": "requests",
    "Value #B (lastNotNull)": "capacity",
    "Value #C (sum)": "limits",
    "node": "node"
    }
    }
    }
    ],
    "type": "barchart"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "fieldConfig": {
    "defaults": {
    "color": {
    "mode": "thresholds"
    },
    "mappings": [],
    "thresholds": {
    "mode": "absolute",
    "steps": [
    {
    "color": "green",
    "value": null
    },
    {
    "color": "red",
    "value": 80
    }
    ]
    },
    "unit": "bytes"
    },
    "overrides": []
    },
    "gridPos": {
    "h": 5,
    "w": 6,
    "x": 12,
    "y": 14
    },
    "id": 11,
    "options": {
    "colorMode": "value",
    "graphMode": "area",
    "justifyMode": "auto",
    "orientation": "auto",
    "reduceOptions": {
    "calcs": [
    "sum"
    ],
    "fields": "/^Value$/",
    "values": false
    },
    "textMode": "auto"
    },
    "pluginVersion": "9.1.5",
    "targets": [
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_pod_container_resource_requests{resource=\"memory\"}",
    "format": "table",
    "instant": true,
    "legendFormat": "__auto",
    "range": false,
    "refId": "A"
    }
    ],
    "title": "total requests",
    "type": "stat"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "fieldConfig": {
    "defaults": {
    "color": {
    "mode": "thresholds"
    },
    "mappings": [],
    "thresholds": {
    "mode": "absolute",
    "steps": [
    {
    "color": "green",
    "value": null
    },
    {
    "color": "red",
    "value": 80
    }
    ]
    },
    "unit": "bytes"
    },
    "overrides": []
    },
    "gridPos": {
    "h": 5,
    "w": 6,
    "x": 18,
    "y": 14
    },
    "id": 12,
    "options": {
    "colorMode": "value",
    "graphMode": "area",
    "justifyMode": "auto",
    "orientation": "auto",
    "reduceOptions": {
    "calcs": [
    "sum"
    ],
    "fields": "/^Value$/",
    "values": false
    },
    "textMode": "auto"
    },
    "pluginVersion": "9.1.5",
    "targets": [
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_pod_container_resource_limits{resource=\"memory\"}",
    "format": "table",
    "instant": true,
    "legendFormat": "__auto",
    "range": false,
    "refId": "A"
    }
    ],
    "title": "total limits",
    "type": "stat"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "fieldConfig": {
    "defaults": {
    "color": {
    "mode": "thresholds"
    },
    "mappings": [],
    "thresholds": {
    "mode": "absolute",
    "steps": [
    {
    "color": "green",
    "value": null
    },
    {
    "color": "red",
    "value": 80
    }
    ]
    },
    "unit": "bytes"
    },
    "overrides": []
    },
    "gridPos": {
    "h": 9,
    "w": 12,
    "x": 12,
    "y": 19
    },
    "id": 13,
    "options": {
    "colorMode": "value",
    "graphMode": "area",
    "justifyMode": "auto",
    "orientation": "auto",
    "reduceOptions": {
    "calcs": [
    "sum"
    ],
    "fields": "/^Value$/",
    "values": false
    },
    "textMode": "auto"
    },
    "pluginVersion": "9.1.5",
    "targets": [
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_node_status_capacity{resource=\"memory\"}",
    "format": "table",
    "instant": true,
    "legendFormat": "__auto",
    "range": false,
    "refId": "A"
    }
    ],
    "title": "total capacity",
    "type": "stat"
    }
    ],
    "title": "Memory",
    "type": "row"
    },
    {
    "collapsed": true,
    "gridPos": {
    "h": 1,
    "w": 24,
    "x": 0,
    "y": 2
    },
    "id": 7,
    "panels": [
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "description": "",
    "fieldConfig": {
    "defaults": {
    "color": {
    "mode": "thresholds"
    },
    "custom": {
    "align": "auto",
    "displayMode": "auto",
    "inspect": false
    },
    "mappings": [],
    "thresholds": {
    "mode": "absolute",
    "steps": [
    {
    "color": "green",
    "value": null
    }
    ]
    },
    "unit": "none"
    },
    "overrides": [
    {
    "matcher": {
    "id": "byName",
    "options": "capacity"
    },
    "properties": [
    {
    "id": "color",
    "value": {
    "fixedColor": "#73BF69",
    "mode": "fixed"
    }
    }
    ]
    },
    {
    "matcher": {
    "id": "byName",
    "options": "requests"
    },
    "properties": [
    {
    "id": "color",
    "value": {
    "fixedColor": "#73BF69",
    "mode": "fixed"
    }
    }
    ]
    },
    {
    "matcher": {
    "id": "byRegexp",
    "options": "^(.*)\\%$"
    },
    "properties": [
    {
    "id": "unit",
    "value": "percentunit"
    },
    {
    "id": "color",
    "value": {
    "mode": "continuous-GrYlRd"
    }
    },
    {
    "id": "thresholds",
    "value": {
    "mode": "absolute",
    "steps": [
    {
    "color": "green",
    "value": null
    },
    {
    "color": "red",
    "value": 0.5
    }
    ]
    }
    }
    ]
    },
    {
    "matcher": {
    "id": "byName",
    "options": "node"
    },
    "properties": [
    {
    "id": "custom.width",
    "value": 259
    }
    ]
    }
    ]
    },
    "gridPos": {
    "h": 12,
    "w": 24,
    "x": 0,
    "y": 3
    },
    "id": 14,
    "options": {
    "footer": {
    "fields": "",
    "reducer": [
    "sum"
    ],
    "show": false
    },
    "showHeader": true,
    "sortBy": [
    {
    "desc": false,
    "displayName": "node"
    }
    ]
    },
    "pluginVersion": "9.1.5",
    "targets": [
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_pod_container_resource_requests{resource=\"cpu\"}",
    "format": "table",
    "instant": true,
    "legendFormat": "{{node}}",
    "range": false,
    "refId": "A"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_pod_container_resource_limits{resource=\"cpu\"}",
    "format": "table",
    "hide": false,
    "instant": true,
    "legendFormat": "{{node}}",
    "range": false,
    "refId": "C"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_node_status_capacity{resource=\"cpu\"}",
    "format": "table",
    "hide": false,
    "instant": true,
    "legendFormat": "{{node}}",
    "range": false,
    "refId": "B"
    }
    ],
    "title": "pod CPU resource by node",
    "transformations": [
    {
    "id": "groupBy",
    "options": {
    "fields": {
    "Value": {
    "aggregations": [
    "sum"
    ],
    "operation": "aggregate"
    },
    "Value #A": {
    "aggregations": [
    "sum"
    ],
    "operation": "aggregate"
    },
    "Value #B": {
    "aggregations": [
    "lastNotNull"
    ],
    "operation": "aggregate"
    },
    "Value #C": {
    "aggregations": [
    "sum"
    ],
    "operation": "aggregate"
    },
    "node": {
    "aggregations": [],
    "operation": "groupby"
    }
    }
    }
    },
    {
    "id": "seriesToColumns",
    "options": {
    "byField": "node"
    }
    },
    {
    "id": "organize",
    "options": {
    "excludeByName": {},
    "indexByName": {},
    "renameByName": {
    "Value #A (sum)": "requests",
    "Value #B (lastNotNull)": "capacity",
    "Value #C (sum)": "limits",
    "node": "node"
    }
    }
    },
    {
    "id": "calculateField",
    "options": {
    "alias": "requests %",
    "binary": {
    "left": "requests",
    "operator": "/",
    "reducer": "sum",
    "right": "capacity"
    },
    "mode": "binary",
    "reduce": {
    "reducer": "diffperc"
    }
    }
    },
    {
    "id": "calculateField",
    "options": {
    "alias": "limits %",
    "binary": {
    "left": "limits",
    "operator": "/",
    "reducer": "sum",
    "right": "capacity"
    },
    "mode": "binary",
    "reduce": {
    "reducer": "sum"
    }
    }
    },
    {
    "id": "organize",
    "options": {
    "excludeByName": {},
    "indexByName": {
    "capacity": 5,
    "limits": 3,
    "limits %": 4,
    "node": 0,
    "requests": 1,
    "requests %": 2
    },
    "renameByName": {}
    }
    }
    ],
    "type": "table"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "description": "",
    "fieldConfig": {
    "defaults": {
    "color": {
    "mode": "thresholds"
    },
    "custom": {
    "axisCenteredZero": false,
    "axisColorMode": "text",
    "axisLabel": "",
    "axisPlacement": "auto",
    "fillOpacity": 80,
    "gradientMode": "none",
    "hideFrom": {
    "legend": false,
    "tooltip": false,
    "viz": false
    },
    "lineWidth": 1,
    "scaleDistribution": {
    "type": "linear"
    }
    },
    "mappings": [],
    "thresholds": {
    "mode": "absolute",
    "steps": [
    {
    "color": "green",
    "value": null
    }
    ]
    },
    "unit": "none"
    },
    "overrides": [
    {
    "matcher": {
    "id": "byName",
    "options": "capacity"
    },
    "properties": [
    {
    "id": "custom.axisPlacement",
    "value": "right"
    },
    {
    "id": "custom.lineWidth",
    "value": 0
    },
    {
    "id": "custom.axisWidth"
    },
    {
    "id": "color",
    "value": {
    "fixedColor": "blue",
    "mode": "fixed"
    }
    }
    ]
    },
    {
    "matcher": {
    "id": "byName",
    "options": "requests"
    },
    "properties": [
    {
    "id": "color",
    "value": {
    "fixedColor": "green",
    "mode": "fixed"
    }
    }
    ]
    },
    {
    "matcher": {
    "id": "byName",
    "options": "limits"
    },
    "properties": [
    {
    "id": "color",
    "value": {
    "fixedColor": "orange",
    "mode": "fixed"
    }
    }
    ]
    }
    ]
    },
    "gridPos": {
    "h": 14,
    "w": 12,
    "x": 0,
    "y": 15
    },
    "id": 15,
    "options": {
    "barRadius": 0,
    "barWidth": 0.97,
    "groupWidth": 0.7,
    "legend": {
    "calcs": [],
    "displayMode": "list",
    "placement": "bottom",
    "showLegend": true
    },
    "orientation": "horizontal",
    "showValue": "auto",
    "stacking": "none",
    "tooltip": {
    "mode": "single",
    "sort": "none"
    },
    "xTickLabelRotation": 0,
    "xTickLabelSpacing": 0
    },
    "pluginVersion": "9.1.5",
    "targets": [
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_pod_container_resource_requests{resource=\"cpu\"}",
    "format": "table",
    "instant": true,
    "legendFormat": "{{node}}",
    "range": false,
    "refId": "A"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_pod_container_resource_limits{resource=\"cpu\"}",
    "format": "table",
    "hide": false,
    "instant": true,
    "legendFormat": "{{node}}",
    "range": false,
    "refId": "C"
    },
    {
    "datasource": {
    "type": "prometheus",
    "uid": "prometheus"
    },
    "editorMode": "code",
    "exemplar": false,
    "expr": "kube_node_status_capacity{resource=\"cpu\"}",
    "format": "table",
    "hide": false,
    "instant": true,
    "legendFormat": "{{node}}",
    "range": false,
    "refId": "B"
    }
    ],
    "title": "Pod cpu by node",
    "transformations": [
    {
    "id": "groupBy",
    "options": {
    "fields": {
    "Value": {
    "aggregations": [
    "sum"
    ],
    "operation": "aggregate"
    },
    "Value #A": {
    "aggregations": [
    "sum"
    ],
    "operation": "aggregate"
    },
    "Value #B": {
    "aggregations": [
    "lastNotNull"
    ],
    "operation": "aggregate"
    },
    "Value #C": {
    "aggregations": [
    "sum"
    ],
    "operation": "aggregate"
    },
    "node": {
    "aggregations": [],
    "operation": "groupby"
    }
    }
    }
    },
    {
    "id": "seriesToColumns",
    "options": {
    "byField": "node"
    }
    },
    {
    "id": "organize",
    "options": {
    "excludeByName": {},
    "indexByName": {},
    "renameByName": {
    "Value #A (sum)": "requests",
    "Value #B (lastNotNull)": "capacity",
    "Value #C (sum)": "limits",
    "node": "node"
    }
    }
    }
    ],
    "type": "barchart"
    }
    ],
    "title": "CPU",
    "type": "row"
    }
    ],
    "schemaVersion": 37,
    "style": "dark",
    "tags": [],
    "templating": {
    "list": []
    },
    "time": {
    "from": "now-6h",
    "to": "now"
    },
    "timepicker": {},
    "timezone": "",
    "title": "Tom K8S node capacity",
    "uid": "OcmxfqX4z",
    "version": 7,
    "weekStart": ""
    }