From 1ee33501bbb2b4fcf0e53912c3a6ae281d658716 Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Mon, 20 Nov 2023 17:50:37 +0100 Subject: [PATCH] Add public dashboard: Container images from docker.io (#404) * Add public dashboard: Container images from docker.io * Update CHANGELOG.md * Include init containers, show pod name in table * Add table filters * Set friendly uid --- CHANGELOG.md | 4 + .../dashboards/mixin/docker-io-images.json | 416 ++++++++++++++++++ 2 files changed, 420 insertions(+) create mode 100644 helm/dashboards/dashboards/mixin/docker-io-images.json diff --git a/CHANGELOG.md b/CHANGELOG.md index fef9ce4a..c97a28d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Public dashboard: Container images from docker.io + ## [3.3.0] - 2023-11-09 ### Added diff --git a/helm/dashboards/dashboards/mixin/docker-io-images.json b/helm/dashboards/dashboards/mixin/docker-io-images.json new file mode 100644 index 00000000..787694f4 --- /dev/null +++ b/helm/dashboards/dashboards/mixin/docker-io-images.json @@ -0,0 +1,416 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Helps to identify workloads using images from Docker Hub (docker.io)", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 118, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "gridPos": { + "h": 4, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 5, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "# Images from docker.io\n\nThis dashboard should help you identify containers using images from `docker.io`. Images from the `giantswarm` registry namespace (`docker.io/giantswarm/*`) are filtered out. If there is no data shown, this means that none of the containers in this installation is using a docker.io image.", + "mode": "markdown" + }, + "pluginVersion": "10.1.5", + "title": "About this dashboard", + "type": "text" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "Count of all containers in workload clusters using images from docker.io, excluding those with prefix \"docker.io/giantswarm\".", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 4 + }, + "id": 6, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(kube_pod_container_info{image=~\"docker.io.*\",image!~\".*/giantswarm/.*\",cluster_type=\"workload_cluster\"} or kube_pod_init_container_info{image=~\"docker.io.*\",image!~\".*/giantswarm/.*\",cluster_type=\"workload_cluster\"})", + "instant": false, + "legendFormat": "Total", + "range": true, + "refId": "A" + } + ], + "title": "Containers over time", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "Details of all containers in workload clusters using images from docker.io, excluding those with prefix \"docker.io/giantswarm\".", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Image" + }, + "properties": [ + { + "id": "custom.width", + "value": 314 + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 13 + }, + "id": 7, + "interval": "1m", + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Namespace" + } + ] + }, + "pluginVersion": "10.1.5", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(kube_pod_container_info{image=~\"docker.io.*\",image!~\".*giantswarm.*\",cluster_type=\"workload_cluster\"} or kube_pod_init_container_info{image=~\"docker.io.*\",image!~\".*giantswarm.*\",cluster_type=\"workload_cluster\"}) by (organization, cluster_id, namespace, pod, container, image)", + "format": "table", + "instant": true, + "legendFormat": "Total", + "range": false, + "refId": "A" + } + ], + "title": "Container details", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true + }, + "indexByName": { + "Time": 7, + "Value": 6, + "cluster_id": 2, + "container": 5, + "image": 0, + "namespace": 3, + "organization": 1, + "pod": 4 + }, + "renameByName": { + "Time": "", + "Value": "Count", + "cluster_id": "Cluster", + "container": "Container name", + "image": "Image", + "namespace": "Namespace", + "organization": "Organization", + "pod": "Pod" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "A flat list of the images used and the number of containers using the image", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Image" + }, + "properties": [ + { + "id": "custom.width", + "value": 314 + } + ] + } + ] + }, + "gridPos": { + "h": 13, + "w": 24, + "x": 0, + "y": 25 + }, + "id": 8, + "interval": "1m", + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Image" + } + ] + }, + "pluginVersion": "10.1.5", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(kube_pod_container_info{image=~\"docker.io.*\",image!~\".*/giantswarm/.*\",cluster_type=\"workload_cluster\"} or kube_pod_init_container_info{image=~\"docker.io.*\",image!~\".*/giantswarm/.*\",cluster_type=\"workload_cluster\"}) by (image)", + "format": "table", + "instant": true, + "legendFormat": "Total", + "range": false, + "refId": "A" + } + ], + "title": "Image list", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true + }, + "indexByName": { + "Time": 6, + "Value": 5, + "cluster_id": 2, + "container": 4, + "image": 0, + "namespace": 3, + "organization": 1 + }, + "renameByName": { + "Time": "", + "Value": "Container count", + "cluster_id": "Cluster", + "container": "Container name", + "image": "Image", + "namespace": "Namespace", + "organization": "Organization" + } + } + } + ], + "type": "table" + } + ], + "refresh": "", + "schemaVersion": 38, + "style": "dark", + "tags": [ + "owner:team-honeybadger" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-3h", + "to": "now" + }, + "timepicker": {}, + "timezone": "utc", + "title": "Container images from docker.io", + "uid": "docker-io-images", + "version": 9, + "weekStart": "" +}