From 8534349b2e9962bca81ea6ecdf1eb93530ecd8de Mon Sep 17 00:00:00 2001 From: Jayme Howard Date: Sat, 2 Apr 2022 12:10:19 -0500 Subject: [PATCH] Fix up deployment a bit more, build a grafana dashboard --- deploy/deployment.yaml | 2 +- grafana/dashboard.json | 300 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 301 insertions(+), 1 deletion(-) create mode 100644 grafana/dashboard.json diff --git a/deploy/deployment.yaml b/deploy/deployment.yaml index 10ec71a..c4a2034 100644 --- a/deploy/deployment.yaml +++ b/deploy/deployment.yaml @@ -23,7 +23,7 @@ spec: spec: containers: - name: kubent-exporter - image: ghcr.io/isugimpy/kubent_exporter:0.0.4 + image: ghcr.io/isugimpy/kubent_exporter:0.0.5 ports: - containerPort: 8000 name: exporterport diff --git a/grafana/dashboard.json b/grafana/dashboard.json new file mode 100644 index 0000000..e6662b7 --- /dev/null +++ b/grafana/dashboard.json @@ -0,0 +1,300 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": null, + "graphTooltip": 0, + "id": 83, + "iteration": 1648918759966, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": null, + "description": "A list of how many objects are on deprecated API versions cluster-wide", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.2.3", + "targets": [ + { + "exemplar": true, + "expr": "count(kubent_deprecated_objects > 0)", + "format": "time_series", + "instant": false, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Deprecated Objects", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "auto", + "filterable": false + }, + "mappings": [ + { + "options": { + "pattern": "^\\{exported_namespace=\"(.*)\"\\}$", + "result": { + "index": 0, + "text": "$1" + } + }, + "type": "regex" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 4, + "options": { + "frameIndex": 0, + "showHeader": true + }, + "pluginVersion": "8.2.3", + "targets": [ + { + "exemplar": true, + "expr": "count by (exported_namespace) (kubent_deprecated_objects > 0)", + "format": "time_series", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Objects By Namespace", + "transformations": [ + { + "id": "seriesToRows", + "options": {} + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true + }, + "indexByName": {}, + "renameByName": { + "Metric": "Namespace" + } + } + } + ], + "type": "table" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "auto" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 16, + "w": 24, + "x": 0, + "y": 9 + }, + "id": 6, + "options": { + "frameIndex": 1, + "showHeader": true + }, + "pluginVersion": "8.2.3", + "targets": [ + { + "exemplar": true, + "expr": "kubent_deprecated_objects{exported_namespace=\"$Namespace\"}", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Deprecated Objects", + "transformations": [ + { + "id": "labelsToFields", + "options": {} + }, + { + "id": "merge", + "options": {} + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "Value": true, + "container": true, + "endpoint": true, + "instance": true, + "job": true, + "namespace": true, + "pod": true + }, + "indexByName": {}, + "renameByName": {} + } + } + ], + "type": "table" + } + ], + "schemaVersion": 31, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "selected": true, + "text": "monitoring", + "value": "monitoring" + }, + "datasource": null, + "definition": "label_values(kubent_deprecated_objects, exported_namespace)", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "Namespace", + "options": [], + "query": { + "query": "label_values(kubent_deprecated_objects, exported_namespace)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Kubent", + "uid": "OgFsKUy7k", + "version": 3 +}