apiVersion: v1
kind: ConfigMap
metadata:
  name: grafana
  namespace: logging
data:
  dashboards.json: |-
    {
      "__inputs": [
        {
          "name": "DS_PROMETHEUS",
          "label": "prometheus",
          "description": "",
          "type": "datasource",
          "pluginId": "prometheus",
          "pluginName": "Prometheus"
        }
      ],
      "__requires": [
        {
          "type": "panel",
          "id": "singlestat",
          "name": "Singlestat",
          "version": ""
        },
        {
          "type": "panel",
          "id": "graph",
          "name": "Graph",
          "version": ""
        },
        {
          "type": "grafana",
          "id": "grafana",
          "name": "Grafana",
          "version": "3.1.1"
        },
        {
          "type": "datasource",
          "id": "prometheus",
          "name": "Prometheus",
          "version": "1.0.0"
        }
      ],
      "id": null,
      "title": "Kubernetes",
      "tags": [],
      "style": "dark",
      "timezone": "browser",
      "editable": true,
      "hideControls": false,
      "sharedCrosshair": false,
      "rows": [
        {
          "title": "New row",
          "height": "250px",
          "editable": true,
          "collapse": false,
          "panels": [
            {
              "title": "Number of Pods",
              "error": false,
              "span": 12,
              "editable": true,
              "type": "singlestat",
              "isNew": true,
              "id": 2,
              "targets": [
                {
                  "refId": "A",
                  "expr": "count(count(container_start_time_seconds{io_kubernetes_pod_name!=\"\"}) by (io_kubernetes_pod_name))",
                  "intervalFactor": 2,
                  "step": 240
                }
              ],
              "links": [],
              "datasource": "${DS_PROMETHEUS}",
              "maxDataPoints": 100,
              "interval": null,
              "cacheTimeout": null,
              "format": "none",
              "prefix": "",
              "postfix": "",
              "nullText": null,
              "valueMaps": [
                {
                  "value": "null",
                  "op": "=",
                  "text": "N/A"
                }
              ],
              "mappingTypes": [
                {
                  "name": "value to text",
                  "value": 1
                },
                {
                  "name": "range to text",
                  "value": 2
                }
              ],
              "rangeMaps": [
                {
                  "from": "null",
                  "to": "null",
                  "text": "N/A"
                }
              ],
              "mappingType": 1,
              "nullPointMode": "connected",
              "valueName": "avg",
              "prefixFontSize": "50%",
              "valueFontSize": "80%",
              "postfixFontSize": "50%",
              "thresholds": "20,25",
              "colorBackground": false,
              "colorValue": false,
              "colors": [
                "rgba(50, 172, 45, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "sparkline": {
                "show": false,
                "full": false,
                "lineColor": "rgb(31, 120, 193)",
                "fillColor": "rgba(31, 118, 189, 0.18)"
              },
              "gauge": {
                "show": true,
                "minValue": 0,
                "maxValue": 30,
                "thresholdMarkers": true,
                "thresholdLabels": false
              }
            }
          ]
        },
        {
          "collapse": false,
          "editable": true,
          "height": "250px",
          "panels": [
            {
              "aliasColors": {},
              "bars": false,
              "datasource": "${DS_PROMETHEUS}",
              "editable": true,
              "error": false,
              "fill": 1,
              "grid": {
                "threshold1": null,
                "threshold1Color": "rgba(216, 200, 27, 0.27)",
                "threshold2": null,
                "threshold2Color": "rgba(234, 112, 112, 0.22)"
              },
              "id": 1,
              "isNew": true,
              "legend": {
                "avg": false,
                "current": false,
                "max": false,
                "min": false,
                "show": true,
                "total": false,
                "values": false
              },
              "lines": true,
              "linewidth": 2,
              "links": [],
              "nullPointMode": "connected",
              "percentage": false,
              "pointradius": 5,
              "points": false,
              "renderer": "flot",
              "seriesOverrides": [],
              "span": 12,
              "stack": false,
              "steppedLine": false,
              "targets": [
                {
                  "expr": "count(count(container_start_time_seconds{io_kubernetes_pod_name!=\"\"}) by (io_kubernetes_pod_name))",
                  "intervalFactor": 2,
                  "legendFormat": "",
                  "refId": "A",
                  "step": 20
                }
              ],
              "timeFrom": null,
              "timeShift": null,
              "title": "Pods",
              "tooltip": {
                "msResolution": true,
                "shared": true,
                "sort": 0,
                "value_type": "cumulative"
              },
              "type": "graph",
              "xaxis": {
                "show": true
              },
              "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
                }
              ]
            }
          ],
          "title": "Row"
        }
      ],
      "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"
        ]
      },
      "templating": {
        "list": []
      },
      "annotations": {
        "list": []
      },
      "refresh": "5s",
      "schemaVersion": 12,
      "version": 5,
      "links": [],
      "gnetId": null
    }