Grafana dashboard: Kubernetes Cluster Overview
Description: Kubernetes集群资源使用统计分布

## November 8th 2021, 6:12 PM  
**要求** 
 
1、Grafana 7.5.11  

**范围**  

Kubernetes集群资源使用统计，及事件消息汇总  

## December 13th 2021, 12:28 PM  
新增WorkNode节点的资源统计（CPU Memory）


{
  "__inputs": [],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.5.11"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "text",
      "name": "Text",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 15208,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1639367820391,
  "links": [],
  "panels": [
    {
      "datasource": null,
      "description": "",
      "fieldConfig": {
        "defaults": {},
        "overrides": []
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 42,
      "options": {
        "content": "",
        "mode": "markdown"
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "queryType": "randomWalk",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "[ Kubernetes] -  集群信息数据统计",
      "type": "text"
    },
    {
      "datasource": "$DataSource",
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "light-blue",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 0,
        "y": 1
      },
      "id": 48,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^v1\\.18.5$/",
          "values": false
        },
        "text": {},
        "textMode": "name"
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "expr": "kubernetes_build_info{instance=~\".+-k8s-cp1\"}",
          "instant": true,
          "interval": "",
          "legendFormat": "{{gitVersion}}",
          "queryType": "randomWalk",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Kubernetes version",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": "$DataSource",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "light-blue",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 3,
        "y": 1
      },
      "id": 49,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^sum\\(kubernetes_build_info\\{kubernetes_io_roles=\"master\"\\}\\)$/",
          "values": false
        },
        "text": {},
        "textMode": "value"
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum(kubernetes_build_info{kubernetes_io_roles=\"master\"})",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "queryType": "randomWalk",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Control Plane",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": "$DataSource",
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "light-blue",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 5,
        "y": 1
      },
      "id": 50,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^sum\\(kubernetes_build_info\\{node_role_kubernetes_io_worker=\"worker\"\\}\\)$/",
          "values": false
        },
        "text": {},
        "textMode": "value"
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum(kubernetes_build_info{node_role_kubernetes_io_worker=\"worker\"})",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "queryType": "randomWalk",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Work node",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": "$DataSource",
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "light-blue",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 7,
        "y": 1
      },
      "id": 51,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^count\\(kube_pod_info\\)$/",
          "values": false
        },
        "text": {},
        "textMode": "value"
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "expr": "count(kube_pod_info)",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "queryType": "randomWalk",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Pod Count",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": "$DataSource",
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "light-blue",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 9,
        "y": 1
      },
      "id": 63,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^count\\(kube_pod_info\\{namespace=\"default\"\\}\\)$/",
          "values": false
        },
        "text": {},
        "textMode": "value"
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "expr": "count(kube_pod_info{namespace=\"$NameSpace\"})",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "queryType": "randomWalk",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Pod Count by namespace",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "light-blue",
                "value": null
              }
            ]
          },
          "unit": "bytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 11,
        "y": 1
      },
      "id": 54,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^sum\\(kube_node_status_capacity_memory_bytes\\{node!~\"\\.\\+cp.+\"\\}\\)$/",
          "values": false
        },
        "text": {},
        "textMode": "value"
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum(kube_node_status_capacity_memory_bytes{node!~\".+cp.+\"})",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "queryType": "randomWalk",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Memory Capacity",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "light-blue",
                "value": null
              }
            ]
          },
          "unit": "bytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 13,
        "y": 1
      },
      "id": 56,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^sum\\(kube_pod_container_resource_requests_memory_bytes\\{node!~\"\\.\\+cp.+\"\\}\\)$/",
          "values": false
        },
        "text": {},
        "textMode": "value"
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "expr": "sum(kube_pod_container_resource_requests_memory_bytes{node!~\".+cp.+\"})",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "queryType": "randomWalk",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Memory requests",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "semi-dark-green",
                "value": null
              }
            ]
          },
          "unit": "bytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 15,
        "y": 1
      },
      "id": 57,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^sum\\(kube_pod_container_resource_limits_memory_bytes\\{node!~\"\\.\\+cp.+\"\\}\\)$/",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "expr": "sum(kube_pod_container_resource_limits_memory_bytes{node!~\".+cp.+\"})",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "queryType": "randomWalk",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Memory limits",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "light-blue",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 18,
        "y": 1
      },
      "id": 55,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^sum\\(kube_node_status_capacity_cpu_cores\\{node!~\"\\.\\+cp.+\"\\}\\)$/",
          "values": false
        },
        "text": {},
        "textMode": "value"
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "expr": "sum(kube_node_status_capacity_cpu_cores{node!~\".+cp.+\"})",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "queryType": "randomWalk",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "CPU Capacity",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "semi-dark-green",
                "value": null
              },
              {
                "color": "semi-dark-red",
                "value": 79
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 20,
        "y": 1
      },
      "id": 59,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^sum\\(kube_pod_container_resource_requests_cpu_cores\\{node!~\"\\.\\+cp.+\"\\}\\)$/",
          "values": false
        },
        "text": {},
        "textMode": "value"
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "expr": "sum(kube_pod_container_resource_requests_cpu_cores{node!~\".+cp.+\"})",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "queryType": "randomWalk",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "CPU requests",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "light-blue",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 22,
        "y": 1
      },
      "id": 62,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^sum\\(kube_pod_container_resource_limits_cpu_cores\\{node!~\"\\.\\+cp.+\"\\}\\)$/",
          "values": false
        },
        "text": {},
        "textMode": "value"
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum(kube_pod_container_resource_limits_cpu_cores{node!~\".+cp.+\"})",
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "queryType": "randomWalk",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "CPU limits",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": null,
            "displayMode": "color-text",
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "bytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 6,
        "x": 0,
        "y": 5
      },
      "id": 43,
      "links": [],
      "options": {
        "frameIndex": 1,
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum(kube_pod_container_resource_limits_memory_bytes{node=~\"prod-be-k8s-wn(1[0-6]|[6-9])\"})",
          "format": "time_series",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "内存受限",
          "refId": "A"
        },
        {
          "exemplar": true,
          "expr": "sum(kube_node_status_capacity_memory_bytes{node=~\"prod-be-k8s-wn(1[0-6]|[6-9])\"})",
          "format": "time_series",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "内存容量",
          "refId": "B"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "资源分配",
      "transformations": [
        {
          "id": "reduce",
          "options": {
            "reducers": [
              "last"
            ]
          }
        },
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {},
            "renameByName": {
              "Field": "Metrics",
              "Last": "值"
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": null,
            "displayMode": "color-text",
            "filterable": false
          },
          "mappings": [
            {
              "from": "",
              "id": 1,
              "text": "Kubenetes_node_capacity_cpu_cores",
              "to": "",
              "type": 1,
              "value": "kube_node_status_capacity_cpu_cores"
            },
            {
              "from": "",
              "id": 2,
              "text": "Kubernetes_node_allcateable_cpu_cores",
              "to": "",
              "type": 1,
              "value": "kube_node_status_allocatable_cpu_cores"
            },
            {
              "from": "",
              "id": 3,
              "text": "Kubernetes_pod_resource_requests_cpu_cores",
              "to": "",
              "type": 1,
              "value": "kube_pod_container_resource_requests_cpu_cores"
            },
            {
              "from": "",
              "id": 4,
              "text": "Kubernetes_pod_resource_limits_cpu_cores",
              "to": "",
              "type": 1,
              "value": "kube_pod_container_resource_limits_cpu_cores"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Total"
            },
            "properties": [
              {
                "id": "custom.displayMode",
                "value": "color-background"
              },
              {
                "id": "color",
                "value": {
                  "fixedColor": "rgba(35, 134, 162, 0.62)",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.width",
                "value": null
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Time"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 197
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Node"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 198
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Metrics"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 353
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 6,
        "w": 9,
        "x": 6,
        "y": 5
      },
      "id": 67,
      "links": [],
      "options": {
        "frameIndex": 2,
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "expr": "sum(kube_node_status_capacity_cpu_cores{node=\"$Node\"})by(__name__,node)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "file descriptior",
          "refId": "A"
        },
        {
          "expr": "sum(kube_node_status_allocatable_cpu_cores{node=~\"$Node\"})by(__name__,node)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "file descriptior",
          "refId": "B"
        },
        {
          "expr": "sum(kube_pod_container_resource_requests_cpu_cores{node=~\"$Node\"})by(__name__,node)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "file descriptior",
          "refId": "C"
        },
        {
          "expr": "sum(kube_pod_container_resource_limits_cpu_cores{node=~\"$Node\"})by(__name__,node)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "file descriptior",
          "refId": "D"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "CPU 使用分配",
      "transformations": [
        {
          "id": "reduce",
          "options": {
            "includeTimeField": true,
            "mode": "reduceFields",
            "reducers": [
              "lastNotNull"
            ]
          }
        },
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "calculateField",
          "options": {
            "alias": "",
            "binary": {
              "left": "Value #A",
              "operator": "+",
              "reducer": "sum",
              "right": ""
            },
            "mode": "reduceRow",
            "reduce": {
              "include": [],
              "reducer": "sum"
            },
            "replaceFields": false
          }
        },
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "__name__",
                "node",
                "Total"
              ]
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {},
            "renameByName": {
              "Total": "",
              "__name__": "Metrics",
              "node": "Node"
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": null,
            "displayMode": "color-text",
            "filterable": false
          },
          "mappings": [
            {
              "from": "",
              "id": 1,
              "text": "Kubernetes_node_capacity_memory_bytes",
              "to": "",
              "type": 1,
              "value": "kube_node_status_capacity_memory_bytes"
            },
            {
              "from": "",
              "id": 2,
              "text": "Kubernetes_node_allocatable_memory_bytes",
              "to": "",
              "type": 1,
              "value": "kube_node_status_allocatable_memory_bytes"
            },
            {
              "from": "",
              "id": 3,
              "text": "Kubernetes_pod_resource_requests_memory_bytes",
              "to": "",
              "type": 1,
              "value": "kube_pod_container_resource_requests_memory_bytes"
            },
            {
              "from": "",
              "id": 4,
              "text": "Kubernetes_pod_resource_limits_memory_bytes",
              "to": "",
              "type": 1,
              "value": "kube_pod_container_resource_limits_memory_bytes"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "bytes"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Total"
            },
            "properties": [
              {
                "id": "custom.displayMode",
                "value": "color-background"
              },
              {
                "id": "color",
                "value": {
                  "fixedColor": "rgba(35, 134, 162, 0.62)",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.width",
                "value": 148
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Time"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 197
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Node"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": null
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Metrics"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 391
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 6,
        "w": 9,
        "x": 15,
        "y": 5
      },
      "id": 61,
      "links": [],
      "options": {
        "frameIndex": 2,
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "expr": "sum(kube_node_status_capacity_memory_bytes{node=\"$Node\"})by(__name__,node)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "file descriptior",
          "refId": "A"
        },
        {
          "expr": "sum(kube_node_status_allocatable_memory_bytes{node=~\"$Node\"})by(__name__,node)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "file descriptior",
          "refId": "B"
        },
        {
          "expr": "sum(kube_pod_container_resource_requests_memory_bytes{node=~\"$Node\"})by(__name__,node)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "file descriptior",
          "refId": "C"
        },
        {
          "expr": "sum(kube_pod_container_resource_limits_memory_bytes{node=~\"$Node\"})by(__name__,node)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "file descriptior",
          "refId": "D"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "内存使用分配",
      "transformations": [
        {
          "id": "reduce",
          "options": {
            "includeTimeField": true,
            "mode": "reduceFields",
            "reducers": [
              "lastNotNull"
            ]
          }
        },
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "calculateField",
          "options": {
            "alias": "",
            "binary": {
              "left": "Value #A",
              "operator": "+",
              "reducer": "sum",
              "right": ""
            },
            "mode": "reduceRow",
            "reduce": {
              "include": [],
              "reducer": "sum"
            },
            "replaceFields": false
          }
        },
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "__name__",
                "node",
                "Total"
              ]
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {},
            "renameByName": {
              "Total": "",
              "__name__": "Metrics",
              "node": "Node"
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": null,
            "displayMode": "color-text",
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 6,
        "x": 0,
        "y": 11
      },
      "id": 68,
      "links": [],
      "options": {
        "frameIndex": 1,
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum(kube_pod_container_resource_limits_cpu_cores{node=~\"prod-be-k8s-wn(1[0-6]|[6-9])\"})",
          "format": "time_series",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "CPU受限",
          "refId": "C"
        },
        {
          "exemplar": true,
          "expr": "sum(kube_node_status_capacity_cpu_cores{node=~\"prod-be-k8s-wn(1[0-6]|[6-9])\"})",
          "format": "time_series",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "CPU容量",
          "refId": "D"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "资源分配",
      "transformations": [
        {
          "id": "reduce",
          "options": {
            "reducers": [
              "last"
            ]
          }
        },
        {
          "id": "merge",
          "options": {}
        }
      ],
      "type": "table"
    },
    {
      "cacheTimeout": null,
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": null,
            "displayMode": "color-text",
            "filterable": false
          },
          "mappings": [],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "__name__"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 202
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "namespace"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 191
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "pod"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 422
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "位置"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 275
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "事件原因"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 346
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 6,
        "w": 18,
        "x": 6,
        "y": 11
      },
      "id": 66,
      "interval": null,
      "links": [],
      "maxDataPoints": 3,
      "options": {
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "expr": "sum(kube_pod_container_status_waiting_reason)by(namespace,pod,reason) == 1",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "10s",
          "legendFormat": "User",
          "refId": "B"
        },
        {
          "expr": "sum(kube_pod_container_status_terminated_reason)by(namespace,pod,reason) == 1",
          "format": "table",
          "hide": true,
          "instant": true,
          "interval": "",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "事件消息",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "Time",
                "namespace",
                "pod",
                "reason"
              ]
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {},
            "renameByName": {
              "Time": "时间",
              "namespace": "位置",
              "pod": "Pod",
              "reason": "事件原因"
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": null,
            "displayMode": "color-text",
            "filterable": false
          },
          "mappings": [
            {
              "from": "",
              "id": 1,
              "text": "Kubenetes_node_capacity_cpu_cores",
              "to": "",
              "type": 1,
              "value": "kube_node_status_capacity_cpu_cores"
            },
            {
              "from": "",
              "id": 2,
              "text": "Kubernetes_node_allcateable_cpu_cores",
              "to": "",
              "type": 1,
              "value": "kube_node_status_allocatable_cpu_cores"
            },
            {
              "from": "",
              "id": 3,
              "text": "Kubernetes_pod_resource_requests_cpu_cores",
              "to": "",
              "type": 1,
              "value": "kube_pod_container_resource_requests_cpu_cores"
            },
            {
              "from": "",
              "id": 4,
              "text": "Kubernetes_pod_resource_limits_cpu_cores",
              "to": "",
              "type": 1,
              "value": "kube_pod_container_resource_limits_cpu_cores"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Service"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 107
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Pod"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 100
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Container"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 103
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "namespace"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 172
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 6,
        "x": 0,
        "y": 17
      },
      "id": 65,
      "links": [],
      "options": {
        "frameIndex": 2,
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "Service"
          }
        ]
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "expr": "count(kube_pod_container_info)by(namespace)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "file descriptior",
          "refId": "D"
        },
        {
          "expr": "count(kube_pod_info)by(namespace)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "file descriptior",
          "refId": "A"
        },
        {
          "expr": "count(kube_service_info)by(namespace)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "file descriptior",
          "refId": "B"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Kubernetes workload",
      "transformations": [
        {
          "id": "reduce",
          "options": {
            "includeTimeField": false,
            "mode": "reduceFields",
            "reducers": []
          }
        },
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "namespace",
                "Value #D",
                "Value #A",
                "Value #B"
              ]
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {},
            "renameByName": {
              "Value #A": "Pod",
              "Value #B": "Service",
              "Value #D": "Container"
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "cacheTimeout": null,
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": null,
            "displayMode": "color-text",
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Time"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 227
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "phase"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 110
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "时间"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 226
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Count"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 203
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "运行阶段"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 150
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "位置"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 149
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 9,
        "x": 6,
        "y": 17
      },
      "id": 39,
      "interval": null,
      "links": [],
      "maxDataPoints": 3,
      "options": {
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "Count"
          }
        ]
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "expr": "sum(kube_pod_status_phase{namespace=\"$NameSpace\"})by(phase,namespace)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "10s",
          "legendFormat": "System",
          "refId": "C"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Pod 运行状态",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {},
            "renameByName": {
              "Time": "时间",
              "Value": "Count",
              "namespace": "位置",
              "phase": "运行阶段"
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "cacheTimeout": null,
      "datasource": "$DataSource",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": null,
            "displayMode": "color-text",
            "filterable": false
          },
          "mappings": [
            {
              "from": "",
              "id": 1,
              "text": "Ready",
              "to": "",
              "type": 1,
              "value": "kube_pod_container_status_ready"
            },
            {
              "from": "",
              "id": 2,
              "text": "Running",
              "to": "",
              "type": 1,
              "value": "kube_pod_container_status_running"
            },
            {
              "from": "",
              "id": 3,
              "text": "Terminated",
              "to": "",
              "type": 1,
              "value": "kube_pod_container_status_terminated"
            },
            {
              "from": "",
              "id": 4,
              "text": "Waiting",
              "to": "",
              "type": 1,
              "value": "kube_pod_container_status_waiting"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "时间"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 204
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "位置"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 166
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "状态"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 150
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 9,
        "x": 15,
        "y": 17
      },
      "id": 64,
      "interval": null,
      "links": [],
      "maxDataPoints": 3,
      "options": {
        "frameIndex": 3,
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "Count"
          }
        ]
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "expr": "sum(kube_pod_container_status_running{namespace=\"$NameSpace\"})by(namespace,__name__)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "10s",
          "legendFormat": "User",
          "refId": "B"
        },
        {
          "expr": "sum(kube_pod_container_status_waiting{namespace=\"$NameSpace\"})by(namespace,__name__)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "10s",
          "legendFormat": "User",
          "refId": "A"
        },
        {
          "expr": "sum(kube_pod_container_status_ready{namespace=\"$NameSpace\"})by(namespace,__name__)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "10s",
          "legendFormat": "User",
          "refId": "C"
        },
        {
          "expr": "sum(kube_pod_container_status_terminated{namespace=\"$NameSpace\"})by(namespace,__name__)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "10s",
          "legendFormat": "User",
          "refId": "D"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Container 运行状态",
      "transformations": [
        {
          "id": "seriesToRows",
          "options": {}
        },
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "calculateField",
          "options": {
            "mode": "reduceRow",
            "reduce": {
              "reducer": "sum"
            },
            "replaceFields": false
          }
        },
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "Time",
                "__name__",
                "namespace",
                "Total"
              ]
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {
              "Time": 0,
              "Total": 3,
              "__name__": 2,
              "namespace": 1
            },
            "renameByName": {
              "Time": "时间",
              "Total": "Count",
              "__name__": "状态",
              "namespace": "位置"
            }
          }
        }
      ],
      "type": "table"
    }
  ],
  "refresh": "5s",
  "schemaVersion": 27,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "生产环境",
          "value": "生产环境"
        },
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "DataSource",
        "multi": false,
        "name": "DataSource",
        "options": [],
        "query": "prometheus",
        "queryValue": "",
        "refresh": 1,
        "regex": "/[^Prometheus]/",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$DataSource",
        "definition": "label_values(kube_namespace_created,namespace)",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "NameSpace",
        "options": [],
        "query": {
          "query": "label_values(kube_namespace_created,namespace)",
          "refId": "生产环境-NameSpace-Variable-Query"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$DataSource",
        "definition": "label_values(kubernetes_build_info,instance)",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "Node",
        "options": [],
        "query": {
          "query": "label_values(kubernetes_build_info,instance)",
          "refId": "生产环境-Node-Variable-Query"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-30m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "Kubernetes Cluster Overview",
  "uid": "KZN7pKJGk",
  "version": 47,
  "description": "Kubernetes集群资源使用统计分布"
}