Grafana dashboard: Kubernetes Pods Metrics
Description: Select Kubernetes Namespace and it will display the Monitoring(Health) data of Kubernetes Pods

Using my own python programming (Multiprocessing & Gevents), I collect kubernetes pods health status and push them to Elasticsearch.

data = {'ts': ts,
                        'mem_avg': float(mem_avg),
                        'cpu_avg': float(cpu_avg),
                        'pod_name': pod_name_val,
                        'deployment_name': deployment_name_val,
                        'namespace': namespace_val}
Above data is sent for each pods for each 5 seconds.


{
  "__inputs": [
    {
      "name": "DS_METRICS_QA_1_CORE",
      "label": "metrics_qa_1_core",
      "description": "Elastic search datasource",
      "type": "datasource",
      "pluginId": "elasticsearch",
      "pluginName": "Elasticsearch"
    }
  ],
  "__requires": [
    {
      "type": "datasource",
      "id": "elasticsearch",
      "name": "Elasticsearch",
      "version": "5.0.0"
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.1.4"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": "5.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 7001,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1531750105743,
  "links": [],
  "panels": [
    {
      "columns": [],
      "datasource": "${DS_METRICS_QA_1_CORE}",
      "fontSize": "100%",
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 6,
      "links": [],
      "minSpan": 24,
      "pageSize": null,
      "repeat": null,
      "repeatDirection": "h",
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": true
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 2,
          "pattern": "/.*/",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "bucketAggs": [
            {
              "field": "pod_name",
              "id": "2",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "10"
              },
              "type": "terms"
            }
          ],
          "hide": false,
          "metrics": [
            {
              "field": "cpu_avg",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "avg"
            },
            {
              "field": "mem_avg",
              "id": "3",
              "meta": {},
              "settings": {},
              "type": "avg"
            },
            {
              "field": "cpu_avg",
              "id": "4",
              "meta": {},
              "settings": {},
              "type": "max"
            },
            {
              "field": "mem_avg",
              "id": "5",
              "meta": {},
              "settings": {},
              "type": "max"
            }
          ],
          "query": "pod_name: $pod",
          "refId": "A",
          "timeField": "ts"
        }
      ],
      "title": "$deployment pods metrics",
      "transform": "table",
      "type": "table"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_METRICS_QA_1_CORE}",
      "fill": 1,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 9
      },
      "id": 2,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "minSpan": 12,
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": "pod",
      "repeatDirection": "h",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "bucketAggs": [
            {
              "field": "ts",
              "id": "2",
              "settings": {
                "interval": "1m",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "hide": false,
          "metrics": [
            {
              "field": "cpu_avg",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "max"
            }
          ],
          "query": "pod_name: $pod",
          "refId": "A",
          "timeField": "ts"
        },
        {
          "bucketAggs": [
            {
              "field": "ts",
              "id": "2",
              "settings": {
                "interval": "1m",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "hide": false,
          "metrics": [
            {
              "field": "mem_avg",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "max"
            }
          ],
          "query": "pod_name: $pod",
          "refId": "B",
          "timeField": "ts"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "$pod Metrics",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "schemaVersion": 16,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_METRICS_QA_1_CORE}",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "namespace",
        "options": [],
        "query": "{\"find\": \"terms\", \"field\": \"namespace\"}",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_METRICS_QA_1_CORE}",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "pod",
        "options": [],
        "query": "{\"find\": \"terms\", \"field\": \"pod_name\",  \"query\": \"namespace:$namespace\"}",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-3h",
    "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 Pods Metrics",
  "uid": "XnQe2Bdiz",
  "version": 4,
  "description": "Select Kubernetes Namespace and it will display the Monitoring(Health) data of Kubernetes Pods"
}