---
apiVersion: v1
kind: ConfigMap
metadata:
  name: helm-version-checker-grafana-dashboard
  labels:
    grafana_dashboard: "1"
    app.kubernetes.io/name: helm-version-checker
    app.kubernetes.io/instance: helm-version-checker
    app.kubernetes.io/version: "v0.0.1"
data:
  helm-version-checker.json: |-
    {
      "annotations": {
        "list": [
          {
            "builtIn": 1,
            "datasource": "Prometheus",
            "enable": true,
            "hide": true,
            "iconColor": "rgba(0, 211, 255, 1)",
            "limit": 100,
            "name": "Annotations & Alerts",
            "showIn": 0,
            "type": "dashboard"
          }
        ]
      },
      "description": "Dashboard for viewing the status of production certificates. To be used with the helm-version-checker project.https://github.com/mogensen/helm-version-checker",
      "editable": true,
      "gnetId": 12833,
      "graphTooltip": 0,
      "links": [],
      "panels": [
        {
          "datasource": null,
          "fieldConfig": {
            "defaults": {
              "mappings": [],
              "min": 0,
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 1
                  }
                ]
              }
            },
            "overrides": []
          },
          "gridPos": {
            "h": 6,
            "w": 12,
            "x": 0,
            "y": 0
          },
          "id": 4,
          "options": {
            "colorMode": "background",
            "graphMode": "area",
            "justifyMode": "auto",
            "orientation": "auto",
            "reduceOptions": {
              "calcs": [
                "lastNotNull"
              ],
              "fields": "",
              "values": false
            },
            "text": {},
            "textMode": "auto"
          },
          "pluginVersion": "8.0.3",
          "targets": [
            {
              "exemplar": true,
              "expr": "count(helm_version_checker_is_latest == 0)",
              "interval": "",
              "legendFormat": "",
              "refId": "A"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Outdated",
          "type": "stat"
        },
        {
          "datasource": null,
          "fieldConfig": {
            "defaults": {
              "mappings": [],
              "min": 0,
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 1
                  }
                ]
              }
            },
            "overrides": []
          },
          "gridPos": {
            "h": 6,
            "w": 12,
            "x": 12,
            "y": 0
          },
          "id": 12,
          "options": {
            "colorMode": "background",
            "graphMode": "area",
            "justifyMode": "auto",
            "orientation": "auto",
            "reduceOptions": {
              "calcs": [
                "lastNotNull"
              ],
              "fields": "",
              "values": false
            },
            "text": {},
            "textMode": "auto"
          },
          "pluginVersion": "8.0.3",
          "targets": [
            {
              "exemplar": true,
              "expr": "count(helm_version_checker_is_deprecated == 1)",
              "interval": "",
              "legendFormat": "",
              "refId": "A"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Deprecated",
          "type": "stat"
        },
        {
          "datasource": "Prometheus",
          "description": "",
          "fieldConfig": {
            "defaults": {
              "color": {
                "fixedColor": "red",
                "mode": "fixed"
              },
              "custom": {
                "align": null,
                "displayMode": "color-text",
                "filterable": false
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              }
            },
            "overrides": []
          },
          "gridPos": {
            "h": 9,
            "w": 24,
            "x": 0,
            "y": 6
          },
          "id": 2,
          "options": {
            "showHeader": true,
            "sortBy": [
              {
                "desc": true,
                "displayName": "Release Name"
              }
            ]
          },
          "pluginVersion": "8.0.3",
          "targets": [
            {
              "exemplar": true,
              "expr": "sum by(exported_namespace, name, installed_version, latest_version) (helm_version_checker_is_latest) == 0",
              "format": "table",
              "instant": true,
              "interval": "",
              "legendFormat": "",
              "refId": "A"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Outdated Helm Releases",
          "transformations": [
            {
              "id": "labelsToFields",
              "options": {}
            },
            {
              "id": "organize",
              "options": {
                "excludeByName": {
                  "Time": true,
                  "Value": true,
                  "container": false
                },
                "indexByName": {
                  "Time": 0,
                  "Value": 3,
                  "exported_namespace": 2,
                  "installed_version": 4,
                  "latest_version": 5,
                  "name": 1
                },
                "renameByName": {
                  "Value": "Is Valid",
                  "current_version": "Current Version",
                  "exported_namespace": "Namespace",
                  "installed_version": "Installed Version",
                  "latest_version": "Latest Version",
                  "name": "Release Name"
                }
              }
            }
          ],
          "type": "table"
        },
        {
          "datasource": "Prometheus",
          "description": "",
          "fieldConfig": {
            "defaults": {
              "color": {
                "fixedColor": "red",
                "mode": "fixed"
              },
              "custom": {
                "align": null,
                "displayMode": "color-text",
                "filterable": false
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              }
            },
            "overrides": []
          },
          "gridPos": {
            "h": 9,
            "w": 24,
            "x": 0,
            "y": 15
          },
          "id": 13,
          "options": {
            "showHeader": true,
            "sortBy": [
              {
                "desc": true,
                "displayName": "Release Name"
              }
            ]
          },
          "pluginVersion": "8.0.3",
          "targets": [
            {
              "exemplar": true,
              "expr": "sum by(exported_namespace, name, installed_version, latest_version) (helm_version_checker_is_deprecated) == 1",
              "format": "table",
              "instant": true,
              "interval": "",
              "legendFormat": "",
              "refId": "A"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Deprecated Helm Releases",
          "transformations": [
            {
              "id": "labelsToFields",
              "options": {}
            },
            {
              "id": "organize",
              "options": {
                "excludeByName": {
                  "Time": true,
                  "Value": true,
                  "container": false
                },
                "indexByName": {
                  "Time": 0,
                  "Value": 3,
                  "exported_namespace": 2,
                  "installed_version": 4,
                  "latest_version": 5,
                  "name": 1
                },
                "renameByName": {
                  "Value": "Is Valid",
                  "current_version": "Current Version",
                  "exported_namespace": "Namespace",
                  "installed_version": "Installed Version",
                  "latest_version": "Latest Version",
                  "name": "Release Name"
                }
              }
            }
          ],
          "type": "table"
        }
      ],
      "refresh": "5m",
      "schemaVersion": 30,
      "style": "dark",
      "tags": [],
      "templating": {
        "list": []
      },
      "time": {
        "from": "now-30m",
        "to": "now"
      },
      "timepicker": {
        "refresh_intervals": [
          "10s",
          "30s",
          "1m",
          "5m",
          "15m",
          "30m",
          "1h",
          "2h",
          "1d"
        ]
      },
      "timezone": "",
      "title": "Helm Version Checker",
      "uid": "helm-version-checker",
      "version": 6
    }
