Grafana dashboard: K8S Cluster Deployments
Description: Dashboard that shows how many deployments occurred by namespace or in the cluster and your workload

With this dashboard it is possible to check how many deployments have been performed on a kubernetes cluster, separated by namespace, application or even the entire cluster.

In addition, it provides realtime CPU and memory information to note differences between deployments.

Version Information:
* Kubernetes: 1.10.8
* Prometheus: 2.4.2
* Kube State Metrics: 1.4.0

Dependencies:
* Kube State Metrics
* [Metrics Server exporter](https://github.com/grupozap/metrics-server-exporter)

{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.4.2"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": "5.0.0"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "text",
      "name": "Text",
      "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": 9619,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1547138209833,
  "links": [],
  "panels": [
    {
      "content": "<div class=\"text-center dashboard-header\">\n  <span>Latest Deployment $namespace / $replicaset</span>\n</div>",
      "gridPos": {
        "h": 2,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 29,
      "links": [],
      "mode": "html",
      "repeat": null,
      "repeatDirection": "h",
      "title": "",
      "transparent": true,
      "type": "text"
    },
    {
      "columns": [],
      "datasource": "${DS_PROMETHEUS}",
      "fontSize": "100%",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 2
      },
      "id": 7,
      "links": [],
      "pageSize": null,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 3,
        "desc": true
      },
      "styles": [
        {
          "alias": "Last deployment",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Value",
          "thresholds": [],
          "type": "date",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Time",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "Namespace",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "exported_namespace",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "ReplicaSet",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "link": false,
          "mappingType": 1,
          "pattern": "replicaset",
          "preserveFormat": false,
          "thresholds": [],
          "type": "string",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "expr": "sort_desc(sum((kube_replicaset_created{job=\"kube-state-metrics\", exported_namespace=\"$namespace\", replicaset=~\"$deployment-[0-9a-fA-F]+\"}) * 1000) by (replicaset, exported_namespace))",
          "format": "table",
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Last  deployments in $namespace / $deployment",
      "transform": "table",
      "type": "table"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "format": "short",
      "gauge": {
        "maxValue": 0,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": false
      },
      "gridPos": {
        "h": 8,
        "w": 4,
        "x": 12,
        "y": 2
      },
      "id": 20,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgb(0, 0, 0)",
        "full": false,
        "lineColor": "#629e51",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "count((kube_replicaset_created{job=\"kube-state-metrics\",exported_namespace=\"$namespace\",replicaset=~\"$deployment.*\"} > time() - 86400))",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "",
      "title": "Deployments in $deployment (last day)",
      "type": "singlestat",
      "valueFontSize": "150%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "format": "short",
      "gauge": {
        "maxValue": 0,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": false
      },
      "gridPos": {
        "h": 8,
        "w": 4,
        "x": 16,
        "y": 2
      },
      "id": 18,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgb(0, 0, 0)",
        "full": false,
        "lineColor": "#629e51",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "count((kube_replicaset_created{job=\"kube-state-metrics\",exported_namespace=\"$namespace\",replicaset=~\"$deployment.*\"} > time() - 604800))",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "",
      "title": "Deployments in $deployment (7 days)",
      "type": "singlestat",
      "valueFontSize": "150%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "format": "short",
      "gauge": {
        "maxValue": 0,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": false
      },
      "gridPos": {
        "h": 8,
        "w": 4,
        "x": 20,
        "y": 2
      },
      "id": 6,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgb(0, 0, 0)",
        "full": false,
        "lineColor": "#629e51",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "count((kube_replicaset_created{job=\"kube-state-metrics\",exported_namespace=\"$namespace\",replicaset=~\"$deployment.*\"} > time() - 2592000))",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "",
      "title": "Deployments in $deployment (last month)",
      "type": "singlestat",
      "valueFontSize": "150%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "collapsed": true,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 10
      },
      "id": 23,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "fill": 1,
          "gridPos": {
            "h": 10,
            "w": 12,
            "x": 0,
            "y": 11
          },
          "id": 25,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "max": true,
            "min": true,
            "rightSide": false,
            "show": false,
            "sort": null,
            "sortDesc": null,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "sum(kube_metrics_server_pods_cpu{pod_namespace=\"$namespace\", pod_name=~\"$deployment-[0-9a-fA-F].*\"}) by (pod_name, pod_container_name) / 1000",
              "format": "time_series",
              "instant": false,
              "intervalFactor": 1,
              "legendFormat": "{{ pod_name }}",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "CPU Stats  - $namespace / $deployment",
          "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
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "fill": 1,
          "gridPos": {
            "h": 10,
            "w": 12,
            "x": 12,
            "y": 11
          },
          "id": 27,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "max": true,
            "min": true,
            "rightSide": false,
            "show": false,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "sum(kube_metrics_server_pods_mem{pod_namespace=\"$namespace\", pod_name=~\"$deployment-[0-9a-fA-F].*\"}) by (pod_name, pod_container_name) / 1000",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "{{ pod_name }} ",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Memory Stats - $namespace / $deployment",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "deckbytes",
              "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
          }
        }
      ],
      "title": "Last deployments workload stats in $deployment",
      "type": "row"
    },
    {
      "collapsed": true,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 11
      },
      "id": 11,
      "panels": [
        {
          "columns": [],
          "datasource": "${DS_PROMETHEUS}",
          "fontSize": "100%",
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 22
          },
          "id": 15,
          "links": [],
          "pageSize": null,
          "scroll": true,
          "showHeader": true,
          "sort": {
            "col": 3,
            "desc": true
          },
          "styles": [
            {
              "alias": "Last deployment",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Value",
              "thresholds": [],
              "type": "date",
              "unit": "short"
            },
            {
              "alias": "",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Time",
              "thresholds": [],
              "type": "hidden",
              "unit": "short"
            },
            {
              "alias": "Namespace",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "exported_namespace",
              "thresholds": [],
              "type": "string",
              "unit": "short"
            },
            {
              "alias": "ReplicaSet",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "mappingType": 1,
              "pattern": "replicaset",
              "preserveFormat": false,
              "thresholds": [],
              "type": "string",
              "unit": "short"
            }
          ],
          "targets": [
            {
              "expr": "sort_desc(sum((kube_replicaset_created{job=\"kube-state-metrics\",exported_namespace=\"$namespace\"} > time() - 604800) * 1000) by (replicaset,exported_namespace))",
              "format": "table",
              "instant": true,
              "intervalFactor": 1,
              "refId": "A"
            }
          ],
          "title": "Last Deployments in $namespace",
          "transform": "table",
          "type": "table"
        },
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "#299c46",
            "rgba(237, 129, 40, 0.89)",
            "#d44a3a"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "format": "short",
          "gauge": {
            "maxValue": 0,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": false
          },
          "gridPos": {
            "h": 8,
            "w": 4,
            "x": 12,
            "y": 22
          },
          "id": 21,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "sparkline": {
            "fillColor": "rgb(0, 0, 0)",
            "full": false,
            "lineColor": "#629e51",
            "show": false
          },
          "tableColumn": "",
          "targets": [
            {
              "expr": "count((kube_replicaset_created{job=\"kube-state-metrics\",exported_namespace=\"$namespace\"} > time() - 86400))",
              "format": "time_series",
              "instant": false,
              "intervalFactor": 1,
              "refId": "A"
            }
          ],
          "thresholds": "",
          "title": "Deployments in $namespace (last day)",
          "type": "singlestat",
          "valueFontSize": "150%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "current"
        },
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "#299c46",
            "rgba(237, 129, 40, 0.89)",
            "#d44a3a"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "format": "short",
          "gauge": {
            "maxValue": 0,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": false
          },
          "gridPos": {
            "h": 8,
            "w": 4,
            "x": 16,
            "y": 22
          },
          "id": 19,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "sparkline": {
            "fillColor": "rgb(0, 0, 0)",
            "full": false,
            "lineColor": "#629e51",
            "show": false
          },
          "tableColumn": "",
          "targets": [
            {
              "expr": "count((kube_replicaset_created{job=\"kube-state-metrics\",exported_namespace=\"$namespace\"} > time() - 604800))",
              "format": "time_series",
              "instant": false,
              "intervalFactor": 1,
              "refId": "A"
            }
          ],
          "thresholds": "",
          "title": "Deployments in $namespace (last 7 days)",
          "type": "singlestat",
          "valueFontSize": "150%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "current"
        },
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "#299c46",
            "rgba(237, 129, 40, 0.89)",
            "#d44a3a"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "format": "short",
          "gauge": {
            "maxValue": 0,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": false
          },
          "gridPos": {
            "h": 8,
            "w": 4,
            "x": 20,
            "y": 22
          },
          "id": 17,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "sparkline": {
            "fillColor": "rgb(0, 0, 0)",
            "full": false,
            "lineColor": "#629e51",
            "show": false
          },
          "tableColumn": "",
          "targets": [
            {
              "expr": "count((kube_replicaset_created{job=\"kube-state-metrics\",exported_namespace=\"$namespace\"} > time() - 2592000))",
              "format": "time_series",
              "instant": false,
              "intervalFactor": 1,
              "refId": "A"
            }
          ],
          "thresholds": "",
          "title": "Deployments in $namespace (last month)",
          "type": "singlestat",
          "valueFontSize": "150%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "current"
        }
      ],
      "title": "Last deployments in $namespace",
      "type": "row"
    },
    {
      "collapsed": true,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 12
      },
      "id": 13,
      "panels": [
        {
          "columns": [],
          "datasource": "${DS_PROMETHEUS}",
          "fontSize": "100%",
          "gridPos": {
            "h": 11,
            "w": 12,
            "x": 0,
            "y": 13
          },
          "id": 2,
          "links": [],
          "pageSize": null,
          "repeat": null,
          "repeatDirection": "h",
          "scroll": true,
          "showHeader": true,
          "sort": {
            "col": 2,
            "desc": false
          },
          "styles": [
            {
              "alias": "Last deployment",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Value",
              "thresholds": [],
              "type": "date",
              "unit": "short"
            },
            {
              "alias": "",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Time",
              "thresholds": [],
              "type": "hidden",
              "unit": "short"
            },
            {
              "alias": "Namespace  - Deployment",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Metric",
              "thresholds": [],
              "type": "string",
              "unit": "short"
            }
          ],
          "targets": [
            {
              "expr": "sum(((kube_replicaset_created{job=\"kube-state-metrics\"} > time() - 604800) * 1000)) by (replicaset, exported_namespace)",
              "format": "time_series",
              "instant": true,
              "intervalFactor": 1,
              "legendFormat": "{{ exported_namespace }} - {{ replicaset }}",
              "refId": "A"
            },
            {
              "expr": "sum(((kube_statefulset_created{job=\"kube-state-metrics\"} > time() - 604800) * 1000)) by (statefulset, exported_namespace)",
              "format": "time_series",
              "instant": true,
              "intervalFactor": 1,
              "legendFormat": "{{ exported_namespace }} - {{ statefulset }}",
              "refId": "B"
            },
            {
              "expr": "sum(((kube_daemonset_created{job=\"kube-state-metrics\"} > time() - 604800) * 1000)) by (daemonset, exported_namespace)",
              "format": "time_series",
              "instant": true,
              "intervalFactor": 1,
              "legendFormat": "{{ exported_namespace }} - {{ daemonset }}",
              "refId": "C"
            }
          ],
          "title": "Last Deployments in Cluster",
          "transform": "timeseries_to_rows",
          "type": "table"
        },
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "#299c46",
            "rgba(237, 129, 40, 0.89)",
            "#d44a3a"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "format": "short",
          "gauge": {
            "maxValue": 0,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": false
          },
          "gridPos": {
            "h": 11,
            "w": 4,
            "x": 12,
            "y": 13
          },
          "id": 5,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "sparkline": {
            "fillColor": "rgb(0, 0, 0)",
            "full": false,
            "lineColor": "#629e51",
            "show": false
          },
          "tableColumn": "",
          "targets": [
            {
              "expr": "count(({__name__=~\"kube_replicaset_created|kube_statefulset_created|kube_daemonset_created\", job=\"kube-state-metrics\"} > time() - 86400))",
              "format": "time_series",
              "instant": false,
              "intervalFactor": 1,
              "refId": "A"
            }
          ],
          "thresholds": "",
          "title": "Deployments in last day",
          "type": "singlestat",
          "valueFontSize": "150%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "current"
        },
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "#299c46",
            "rgba(237, 129, 40, 0.89)",
            "#d44a3a"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "format": "short",
          "gauge": {
            "maxValue": 0,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": false
          },
          "gridPos": {
            "h": 11,
            "w": 4,
            "x": 16,
            "y": 13
          },
          "id": 4,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "sparkline": {
            "fillColor": "rgb(0, 0, 0)",
            "full": false,
            "lineColor": "#629e51",
            "show": false
          },
          "tableColumn": "",
          "targets": [
            {
              "expr": "count(({__name__=~\"kube_replicaset_created|kube_statefulset_created|kube_daemonset_created\", job=\"kube-state-metrics\"} > time() - 604800))",
              "format": "time_series",
              "instant": false,
              "intervalFactor": 1,
              "refId": "A"
            }
          ],
          "thresholds": "",
          "title": "Deployments in last 7 days",
          "type": "singlestat",
          "valueFontSize": "150%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "current"
        },
        {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "#299c46",
            "rgba(237, 129, 40, 0.89)",
            "#d44a3a"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "format": "short",
          "gauge": {
            "maxValue": 0,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": false
          },
          "gridPos": {
            "h": 11,
            "w": 4,
            "x": 20,
            "y": 13
          },
          "id": 16,
          "interval": null,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [
            {
              "name": "value to text",
              "value": 1
            },
            {
              "name": "range to text",
              "value": 2
            }
          ],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [
            {
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "sparkline": {
            "fillColor": "rgb(0, 0, 0)",
            "full": false,
            "lineColor": "#629e51",
            "show": false
          },
          "tableColumn": "",
          "targets": [
            {
              "expr": "count(({__name__=~\"kube_replicaset_created|kube_statefulset_created|kube_daemonset_created\", job=\"kube-state-metrics\"} > time() - 2592000))",
              "format": "time_series",
              "instant": false,
              "intervalFactor": 1,
              "refId": "A"
            }
          ],
          "thresholds": "",
          "title": "Deployments in last month",
          "type": "singlestat",
          "valueFontSize": "150%",
          "valueMaps": [
            {
              "op": "=",
              "text": "N/A",
              "value": "null"
            }
          ],
          "valueName": "current"
        }
      ],
      "title": "Last deployments in Cluster",
      "type": "row"
    }
  ],
  "refresh": false,
  "schemaVersion": 16,
  "style": "dark",
  "tags": [
    "k8s",
    "prometheus"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "",
        "hide": 0,
        "includeAll": false,
        "label": "Namespace",
        "multi": false,
        "name": "namespace",
        "options": [],
        "query": "label_values(kube_replicaset_created{job=\"kube-state-metrics\"} , exported_namespace)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "",
        "hide": 0,
        "includeAll": false,
        "label": "Deployment",
        "multi": false,
        "name": "deployment",
        "options": [],
        "query": "label_values(kube_deployment_labels{job=\"kube-state-metrics\", exported_namespace=\"$namespace\"} , deployment)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "",
        "hide": 2,
        "includeAll": false,
        "label": "ReplicaSet",
        "multi": false,
        "name": "replicaset",
        "options": [],
        "query": "query_result(topk(1, kube_replicaset_created{job=\"kube-state-metrics\", exported_namespace=\"$namespace\", replicaset=~\"$deployment-[0-9a-fA-F]+\"}))",
        "refresh": 1,
        "regex": "/replicaset=\\\"(.*-[0-9a-fA-F]+)\\\"/",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-5m",
    "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": "K8S Cluster Deployments",
  "uid": "lV0IZcBmz",
  "version": 45,
  "description": "Dashboard that shows how many deployments occurred by namespace or in the cluster and your workload"
}