diff --git a/app/kumactl/cmd/install/context/install_metrics_context.go b/app/kumactl/cmd/install/context/install_metrics_context.go index bead0507aa4c..8a560e3d9349 100644 --- a/app/kumactl/cmd/install/context/install_metrics_context.go +++ b/app/kumactl/cmd/install/context/install_metrics_context.go @@ -13,6 +13,7 @@ type MetricsTemplateArgs struct { KumaPrometheusSdImage string KumaPrometheusSdVersion string KumaCpAddress string + KumaCpApiAddress string WithoutPrometheus bool WithoutGrafana bool Dashboards []Dashboard @@ -29,6 +30,7 @@ func DefaultInstallMetricsContext() InstallMetricsContext { KumaPrometheusSdImage: "docker.io/kumahq/kuma-prometheus-sd", KumaPrometheusSdVersion: kuma_version.Build.GitTag, KumaCpAddress: "grpc://kuma-control-plane.kuma-system:5676", + KumaCpApiAddress: "http://kuma-control-plane.kuma-system:5681", WithoutPrometheus: false, WithoutGrafana: false, }, diff --git a/app/kumactl/cmd/install/testdata/install-metrics.defaults.golden.yaml b/app/kumactl/cmd/install/testdata/install-metrics.defaults.golden.yaml index 714acf6a3cad..276ac701aec2 100644 --- a/app/kumactl/cmd/install/testdata/install-metrics.defaults.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-metrics.defaults.golden.yaml @@ -130,6 +130,9 @@ data: logs = /var/log/grafana plugins = /var/lib/grafana/plugins provisioning = /etc/grafana/provisioning + [plugins] + # Required until we have grafana sign our plugin. + allow_loading_unsigned_plugins = "kumahq-kuma-datasource" --- apiVersion: v1 kind: ConfigMap @@ -209,6 +212,11 @@ data: version: 1 # allow users to edit datasources from the UI. editable: true + - name: Kuma + type: kumahq-kuma-datasource + url: http://kuma-control-plane.kuma-system:5681 + jsonData: + prometheusDataSourceId: "1" --- apiVersion: v1 kind: ConfigMap @@ -3359,6 +3367,12 @@ data: "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, "type": "dashboard" } ] @@ -3380,6 +3394,45 @@ data: "x": 0, "y": 0 }, + "id": 30, + "panels": [], + "title": "Service Map", + "type": "row" + }, + { + "datasource": "Kuma", + "gridPos": { + "h": 14, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 32, + "interval": "1m", + "targets": [ + { + "hide": false, + "mesh": "$mesh", + "queryType": "mesh-graph", + "refId": "A" + } + ], + "title": "Service Map", + "type": "nodeGraph" + }, + { + "collapsed": false, + "datasource": null, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, "id": 23, "panels": [], "title": "HTTP", @@ -3391,19 +3444,13 @@ data: "dashLength": 10, "dashes": false, "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 0, - "y": 1 + "y": 16 }, "hiddenSeries": false, "id": 25, @@ -3423,7 +3470,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3489,19 +3536,13 @@ data: "dashLength": 10, "dashes": false, "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 8, - "y": 1 + "y": 16 }, "hiddenSeries": false, "id": 26, @@ -3521,7 +3562,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3587,19 +3628,13 @@ data: "dashLength": 10, "dashes": false, "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 16, - "y": 1 + "y": 16 }, "hiddenSeries": false, "id": 28, @@ -3619,7 +3654,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3682,11 +3717,15 @@ data: { "collapsed": false, "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 10 + "y": 25 }, "id": 16, "panels": [], @@ -3702,7 +3741,6 @@ data: "description": "Data is only available if HealthCheck policy is applied.", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -3713,7 +3751,7 @@ data: "h": 7, "w": 24, "x": 0, - "y": 11 + "y": 26 }, "hiddenSeries": false, "id": 9, @@ -3733,7 +3771,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3792,11 +3830,15 @@ data: { "collapsed": false, "datasource": null, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 18 + "y": 33 }, "id": 19, "panels": [], @@ -3810,19 +3852,13 @@ data: "dashes": false, "datasource": null, "description": "Total times that the cluster’s connection circuit breaker overflowed", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 12, "x": 0, - "y": 19 + "y": 34 }, "hiddenSeries": false, "id": 21, @@ -3842,7 +3878,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3924,7 +3960,6 @@ data: "description": "Data is only available if HealthCheck policy is applied. Note that passive health checks are executed on healthy instances marked by active health checks.", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -3935,7 +3970,7 @@ data: "h": 8, "w": 12, "x": 12, - "y": 19 + "y": 34 }, "hiddenSeries": false, "id": 17, @@ -3955,7 +3990,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -4015,11 +4050,15 @@ data: { "collapsed": false, "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 27 + "y": 42 }, "id": 12, "panels": [], @@ -4034,7 +4073,6 @@ data: "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -4045,7 +4083,7 @@ data: "h": 7, "w": 12, "x": 0, - "y": 28 + "y": 43 }, "hiddenSeries": false, "id": 2, @@ -4067,7 +4105,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -4152,7 +4190,6 @@ data: "description": "Note that if Control Plane does not sent FIN segment, Dataplanes can still think that connection is up waiting for new update even that Control Plane is down.", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -4163,7 +4200,7 @@ data: "h": 7, "w": 12, "x": 12, - "y": 28 + "y": 43 }, "hiddenSeries": false, "id": 3, @@ -4185,7 +4222,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -4267,7 +4304,6 @@ data: "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -4278,7 +4314,7 @@ data: "h": 8, "w": 12, "x": 0, - "y": 35 + "y": 50 }, "hiddenSeries": false, "id": 5, @@ -4298,7 +4334,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -4367,7 +4403,6 @@ data: "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -4378,7 +4413,7 @@ data: "h": 8, "w": 12, "x": 12, - "y": 35 + "y": 50 }, "hiddenSeries": false, "id": 7, @@ -4402,7 +4437,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -4497,7 +4532,7 @@ data: } ], "refresh": "5s", - "schemaVersion": 27, + "schemaVersion": 30, "style": "dark", "tags": [], "templating": { @@ -4528,7 +4563,6 @@ data: "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", - "tags": [], "tagsQuery": "", "type": "query", "useTags": false @@ -11841,9 +11875,16 @@ spec: securityContext: fsGroup: 472 runAsUser: 472 + initContainers: + - name: init-plugins + image: alpine + command: [ '/bin/sh', '-c', 'wget -O /tmp/kuma.zip https://github.com/kumahq/kuma-grafana-datasource/releases/download/v0.0.3/kumahq-kuma-datasource-0.0.3.zip && unzip /tmp/kuma.zip -d /var/lib/grafana/plugins/ && rm /tmp/kuma.zip'] + volumeMounts: + - name: plugins-volume + mountPath: /var/lib/grafana/plugins containers: - name: grafana - image: "grafana/grafana:7.5.8" + image: "grafana/grafana:8.1.2" imagePullPolicy: IfNotPresent volumeMounts: - name: config @@ -11858,6 +11899,9 @@ spec: - name: provisioning-dashboards mountPath: /etc/grafana/provisioning/dashboards readOnly: true + - name: plugins-volume + mountPath: /var/lib/grafana/plugins + readOnly: true ports: - name: service containerPort: 80 @@ -11908,6 +11952,8 @@ spec: - name: storage emptyDir: {} + - name: plugins-volume + emptyDir: {} --- # Source: prometheus/templates/alertmanager-deployment.yaml apiVersion: apps/v1 diff --git a/app/kumactl/cmd/install/testdata/install-metrics.no-prometheus.golden.yaml b/app/kumactl/cmd/install/testdata/install-metrics.no-prometheus.golden.yaml index bcbf1bc1d833..9f9eff422ae8 100644 --- a/app/kumactl/cmd/install/testdata/install-metrics.no-prometheus.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-metrics.no-prometheus.golden.yaml @@ -85,6 +85,9 @@ data: logs = /var/log/grafana plugins = /var/lib/grafana/plugins provisioning = /etc/grafana/provisioning + [plugins] + # Required until we have grafana sign our plugin. + allow_loading_unsigned_plugins = "kumahq-kuma-datasource" --- apiVersion: v1 kind: ConfigMap @@ -145,6 +148,11 @@ data: version: 1 # allow users to edit datasources from the UI. editable: true + - name: Kuma + type: kumahq-kuma-datasource + url: http://kuma-control-plane.kuma-system:5681 + jsonData: + prometheusDataSourceId: "1" --- apiVersion: v1 kind: ConfigMap @@ -2995,6 +3003,12 @@ data: "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, "type": "dashboard" } ] @@ -3016,6 +3030,45 @@ data: "x": 0, "y": 0 }, + "id": 30, + "panels": [], + "title": "Service Map", + "type": "row" + }, + { + "datasource": "Kuma", + "gridPos": { + "h": 14, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 32, + "interval": "1m", + "targets": [ + { + "hide": false, + "mesh": "$mesh", + "queryType": "mesh-graph", + "refId": "A" + } + ], + "title": "Service Map", + "type": "nodeGraph" + }, + { + "collapsed": false, + "datasource": null, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, "id": 23, "panels": [], "title": "HTTP", @@ -3027,19 +3080,13 @@ data: "dashLength": 10, "dashes": false, "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 0, - "y": 1 + "y": 16 }, "hiddenSeries": false, "id": 25, @@ -3059,7 +3106,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3125,19 +3172,13 @@ data: "dashLength": 10, "dashes": false, "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 8, - "y": 1 + "y": 16 }, "hiddenSeries": false, "id": 26, @@ -3157,7 +3198,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3223,19 +3264,13 @@ data: "dashLength": 10, "dashes": false, "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 16, - "y": 1 + "y": 16 }, "hiddenSeries": false, "id": 28, @@ -3255,7 +3290,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3318,11 +3353,15 @@ data: { "collapsed": false, "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 10 + "y": 25 }, "id": 16, "panels": [], @@ -3338,7 +3377,6 @@ data: "description": "Data is only available if HealthCheck policy is applied.", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -3349,7 +3387,7 @@ data: "h": 7, "w": 24, "x": 0, - "y": 11 + "y": 26 }, "hiddenSeries": false, "id": 9, @@ -3369,7 +3407,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3428,11 +3466,15 @@ data: { "collapsed": false, "datasource": null, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 18 + "y": 33 }, "id": 19, "panels": [], @@ -3446,19 +3488,13 @@ data: "dashes": false, "datasource": null, "description": "Total times that the cluster’s connection circuit breaker overflowed", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 12, "x": 0, - "y": 19 + "y": 34 }, "hiddenSeries": false, "id": 21, @@ -3478,7 +3514,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3560,7 +3596,6 @@ data: "description": "Data is only available if HealthCheck policy is applied. Note that passive health checks are executed on healthy instances marked by active health checks.", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -3571,7 +3606,7 @@ data: "h": 8, "w": 12, "x": 12, - "y": 19 + "y": 34 }, "hiddenSeries": false, "id": 17, @@ -3591,7 +3626,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3651,11 +3686,15 @@ data: { "collapsed": false, "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 27 + "y": 42 }, "id": 12, "panels": [], @@ -3670,7 +3709,6 @@ data: "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -3681,7 +3719,7 @@ data: "h": 7, "w": 12, "x": 0, - "y": 28 + "y": 43 }, "hiddenSeries": false, "id": 2, @@ -3703,7 +3741,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3788,7 +3826,6 @@ data: "description": "Note that if Control Plane does not sent FIN segment, Dataplanes can still think that connection is up waiting for new update even that Control Plane is down.", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -3799,7 +3836,7 @@ data: "h": 7, "w": 12, "x": 12, - "y": 28 + "y": 43 }, "hiddenSeries": false, "id": 3, @@ -3821,7 +3858,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3903,7 +3940,6 @@ data: "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -3914,7 +3950,7 @@ data: "h": 8, "w": 12, "x": 0, - "y": 35 + "y": 50 }, "hiddenSeries": false, "id": 5, @@ -3934,7 +3970,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -4003,7 +4039,6 @@ data: "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -4014,7 +4049,7 @@ data: "h": 8, "w": 12, "x": 12, - "y": 35 + "y": 50 }, "hiddenSeries": false, "id": 7, @@ -4038,7 +4073,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -4133,7 +4168,7 @@ data: } ], "refresh": "5s", - "schemaVersion": 27, + "schemaVersion": 30, "style": "dark", "tags": [], "templating": { @@ -4164,7 +4199,6 @@ data: "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", - "tags": [], "tagsQuery": "", "type": "query", "useTags": false @@ -11062,9 +11096,16 @@ spec: securityContext: fsGroup: 472 runAsUser: 472 + initContainers: + - name: init-plugins + image: alpine + command: [ '/bin/sh', '-c', 'wget -O /tmp/kuma.zip https://github.com/kumahq/kuma-grafana-datasource/releases/download/v0.0.3/kumahq-kuma-datasource-0.0.3.zip && unzip /tmp/kuma.zip -d /var/lib/grafana/plugins/ && rm /tmp/kuma.zip'] + volumeMounts: + - name: plugins-volume + mountPath: /var/lib/grafana/plugins containers: - name: grafana - image: "grafana/grafana:7.5.8" + image: "grafana/grafana:8.1.2" imagePullPolicy: IfNotPresent volumeMounts: - name: config @@ -11079,6 +11120,9 @@ spec: - name: provisioning-dashboards mountPath: /etc/grafana/provisioning/dashboards readOnly: true + - name: plugins-volume + mountPath: /var/lib/grafana/plugins + readOnly: true ports: - name: service containerPort: 80 @@ -11128,4 +11172,6 @@ spec: name: provisioning-dashboards-4 - name: storage + emptyDir: {} + - name: plugins-volume emptyDir: {} \ No newline at end of file diff --git a/app/kumactl/cmd/install/testdata/install-metrics.overrides.golden.yaml b/app/kumactl/cmd/install/testdata/install-metrics.overrides.golden.yaml index eb053a9b854a..6398ebd05176 100644 --- a/app/kumactl/cmd/install/testdata/install-metrics.overrides.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-metrics.overrides.golden.yaml @@ -130,6 +130,9 @@ data: logs = /var/log/grafana plugins = /var/lib/grafana/plugins provisioning = /etc/grafana/provisioning + [plugins] + # Required until we have grafana sign our plugin. + allow_loading_unsigned_plugins = "kumahq-kuma-datasource" --- apiVersion: v1 kind: ConfigMap @@ -209,6 +212,11 @@ data: version: 1 # allow users to edit datasources from the UI. editable: true + - name: Kuma + type: kumahq-kuma-datasource + url: http://kuma-control-plane.kuma-system:5681 + jsonData: + prometheusDataSourceId: "1" --- apiVersion: v1 kind: ConfigMap @@ -3359,6 +3367,12 @@ data: "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, "type": "dashboard" } ] @@ -3380,6 +3394,45 @@ data: "x": 0, "y": 0 }, + "id": 30, + "panels": [], + "title": "Service Map", + "type": "row" + }, + { + "datasource": "Kuma", + "gridPos": { + "h": 14, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 32, + "interval": "1m", + "targets": [ + { + "hide": false, + "mesh": "$mesh", + "queryType": "mesh-graph", + "refId": "A" + } + ], + "title": "Service Map", + "type": "nodeGraph" + }, + { + "collapsed": false, + "datasource": null, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, "id": 23, "panels": [], "title": "HTTP", @@ -3391,19 +3444,13 @@ data: "dashLength": 10, "dashes": false, "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 0, - "y": 1 + "y": 16 }, "hiddenSeries": false, "id": 25, @@ -3423,7 +3470,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3489,19 +3536,13 @@ data: "dashLength": 10, "dashes": false, "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 8, - "y": 1 + "y": 16 }, "hiddenSeries": false, "id": 26, @@ -3521,7 +3562,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3587,19 +3628,13 @@ data: "dashLength": 10, "dashes": false, "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 16, - "y": 1 + "y": 16 }, "hiddenSeries": false, "id": 28, @@ -3619,7 +3654,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3682,11 +3717,15 @@ data: { "collapsed": false, "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 10 + "y": 25 }, "id": 16, "panels": [], @@ -3702,7 +3741,6 @@ data: "description": "Data is only available if HealthCheck policy is applied.", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -3713,7 +3751,7 @@ data: "h": 7, "w": 24, "x": 0, - "y": 11 + "y": 26 }, "hiddenSeries": false, "id": 9, @@ -3733,7 +3771,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3792,11 +3830,15 @@ data: { "collapsed": false, "datasource": null, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 18 + "y": 33 }, "id": 19, "panels": [], @@ -3810,19 +3852,13 @@ data: "dashes": false, "datasource": null, "description": "Total times that the cluster’s connection circuit breaker overflowed", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 12, "x": 0, - "y": 19 + "y": 34 }, "hiddenSeries": false, "id": 21, @@ -3842,7 +3878,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -3924,7 +3960,6 @@ data: "description": "Data is only available if HealthCheck policy is applied. Note that passive health checks are executed on healthy instances marked by active health checks.", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -3935,7 +3970,7 @@ data: "h": 8, "w": 12, "x": 12, - "y": 19 + "y": 34 }, "hiddenSeries": false, "id": 17, @@ -3955,7 +3990,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -4015,11 +4050,15 @@ data: { "collapsed": false, "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 27 + "y": 42 }, "id": 12, "panels": [], @@ -4034,7 +4073,6 @@ data: "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -4045,7 +4083,7 @@ data: "h": 7, "w": 12, "x": 0, - "y": 28 + "y": 43 }, "hiddenSeries": false, "id": 2, @@ -4067,7 +4105,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -4152,7 +4190,6 @@ data: "description": "Note that if Control Plane does not sent FIN segment, Dataplanes can still think that connection is up waiting for new update even that Control Plane is down.", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -4163,7 +4200,7 @@ data: "h": 7, "w": 12, "x": 12, - "y": 28 + "y": 43 }, "hiddenSeries": false, "id": 3, @@ -4185,7 +4222,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -4267,7 +4304,6 @@ data: "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -4278,7 +4314,7 @@ data: "h": 8, "w": 12, "x": 0, - "y": 35 + "y": 50 }, "hiddenSeries": false, "id": 5, @@ -4298,7 +4334,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -4367,7 +4403,6 @@ data: "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -4378,7 +4413,7 @@ data: "h": 8, "w": 12, "x": 12, - "y": 35 + "y": 50 }, "hiddenSeries": false, "id": 7, @@ -4402,7 +4437,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -4497,7 +4532,7 @@ data: } ], "refresh": "5s", - "schemaVersion": 27, + "schemaVersion": 30, "style": "dark", "tags": [], "templating": { @@ -4528,7 +4563,6 @@ data: "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", - "tags": [], "tagsQuery": "", "type": "query", "useTags": false @@ -11841,9 +11875,16 @@ spec: securityContext: fsGroup: 472 runAsUser: 472 + initContainers: + - name: init-plugins + image: alpine + command: [ '/bin/sh', '-c', 'wget -O /tmp/kuma.zip https://github.com/kumahq/kuma-grafana-datasource/releases/download/v0.0.3/kumahq-kuma-datasource-0.0.3.zip && unzip /tmp/kuma.zip -d /var/lib/grafana/plugins/ && rm /tmp/kuma.zip'] + volumeMounts: + - name: plugins-volume + mountPath: /var/lib/grafana/plugins containers: - name: grafana - image: "grafana/grafana:7.5.8" + image: "grafana/grafana:8.1.2" imagePullPolicy: IfNotPresent volumeMounts: - name: config @@ -11858,6 +11899,9 @@ spec: - name: provisioning-dashboards mountPath: /etc/grafana/provisioning/dashboards readOnly: true + - name: plugins-volume + mountPath: /var/lib/grafana/plugins + readOnly: true ports: - name: service containerPort: 80 @@ -11908,6 +11952,8 @@ spec: - name: storage emptyDir: {} + - name: plugins-volume + emptyDir: {} --- # Source: prometheus/templates/alertmanager-deployment.yaml apiVersion: apps/v1 diff --git a/app/kumactl/data/install/k8s/metrics/grafana/grafana.yaml b/app/kumactl/data/install/k8s/metrics/grafana/grafana.yaml index 23ffb65b3286..f4cbb94e509f 100644 --- a/app/kumactl/data/install/k8s/metrics/grafana/grafana.yaml +++ b/app/kumactl/data/install/k8s/metrics/grafana/grafana.yaml @@ -68,6 +68,9 @@ data: logs = /var/log/grafana plugins = /var/lib/grafana/plugins provisioning = /etc/grafana/provisioning + [plugins] + # Required until we have grafana sign our plugin. + allow_loading_unsigned_plugins = "kumahq-kuma-datasource" --- apiVersion: v1 kind: ConfigMap @@ -128,6 +131,11 @@ data: version: 1 # allow users to edit datasources from the UI. editable: true + - name: Kuma + type: kumahq-kuma-datasource + url: {{.KumaCpApiAddress}} + jsonData: + prometheusDataSourceId: "1" --- apiVersion: v1 kind: ConfigMap @@ -269,9 +277,16 @@ spec: securityContext: fsGroup: 472 runAsUser: 472 + initContainers: + - name: init-plugins + image: alpine + command: [ '/bin/sh', '-c', 'wget -O /tmp/kuma.zip https://github.com/kumahq/kuma-grafana-datasource/releases/download/v0.0.3/kumahq-kuma-datasource-0.0.3.zip && unzip /tmp/kuma.zip -d /var/lib/grafana/plugins/ && rm /tmp/kuma.zip'] + volumeMounts: + - name: plugins-volume + mountPath: /var/lib/grafana/plugins containers: - name: grafana - image: "grafana/grafana:7.5.8" + image: "grafana/grafana:8.1.2" imagePullPolicy: IfNotPresent volumeMounts: - name: config @@ -286,6 +301,9 @@ spec: - name: provisioning-dashboards mountPath: /etc/grafana/provisioning/dashboards readOnly: true + - name: plugins-volume + mountPath: /var/lib/grafana/plugins + readOnly: true ports: - name: service containerPort: 80 @@ -324,3 +342,5 @@ spec: {{ end }} - name: storage emptyDir: {} + - name: plugins-volume + emptyDir: {} diff --git a/app/kumactl/data/install/k8s/metrics/grafana/kuma-mesh.json b/app/kumactl/data/install/k8s/metrics/grafana/kuma-mesh.json index fb0cabad0731..6a236eb99174 100644 --- a/app/kumactl/data/install/k8s/metrics/grafana/kuma-mesh.json +++ b/app/kumactl/data/install/k8s/metrics/grafana/kuma-mesh.json @@ -8,6 +8,12 @@ "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, "type": "dashboard" } ] @@ -29,6 +35,45 @@ "x": 0, "y": 0 }, + "id": 30, + "panels": [], + "title": "Service Map", + "type": "row" + }, + { + "datasource": "Kuma", + "gridPos": { + "h": 14, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 32, + "interval": "1m", + "targets": [ + { + "hide": false, + "mesh": "$mesh", + "queryType": "mesh-graph", + "refId": "A" + } + ], + "title": "Service Map", + "type": "nodeGraph" + }, + { + "collapsed": false, + "datasource": null, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, "id": 23, "panels": [], "title": "HTTP", @@ -40,19 +85,13 @@ "dashLength": 10, "dashes": false, "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 0, - "y": 1 + "y": 16 }, "hiddenSeries": false, "id": 25, @@ -72,7 +111,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -138,19 +177,13 @@ "dashLength": 10, "dashes": false, "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 8, - "y": 1 + "y": 16 }, "hiddenSeries": false, "id": 26, @@ -170,7 +203,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -236,19 +269,13 @@ "dashLength": 10, "dashes": false, "datasource": null, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 16, - "y": 1 + "y": 16 }, "hiddenSeries": false, "id": 28, @@ -268,7 +295,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -331,11 +358,15 @@ { "collapsed": false, "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 10 + "y": 25 }, "id": 16, "panels": [], @@ -351,7 +382,6 @@ "description": "Data is only available if HealthCheck policy is applied.", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -362,7 +392,7 @@ "h": 7, "w": 24, "x": 0, - "y": 11 + "y": 26 }, "hiddenSeries": false, "id": 9, @@ -382,7 +412,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -441,11 +471,15 @@ { "collapsed": false, "datasource": null, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 18 + "y": 33 }, "id": 19, "panels": [], @@ -459,19 +493,13 @@ "dashes": false, "datasource": null, "description": "Total times that the cluster’s connection circuit breaker overflowed", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 12, "x": 0, - "y": 19 + "y": 34 }, "hiddenSeries": false, "id": 21, @@ -491,7 +519,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -573,7 +601,6 @@ "description": "Data is only available if HealthCheck policy is applied. Note that passive health checks are executed on healthy instances marked by active health checks.", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -584,7 +611,7 @@ "h": 8, "w": 12, "x": 12, - "y": 19 + "y": 34 }, "hiddenSeries": false, "id": 17, @@ -604,7 +631,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -664,11 +691,15 @@ { "collapsed": false, "datasource": "Prometheus", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 27 + "y": 42 }, "id": 12, "panels": [], @@ -683,7 +714,6 @@ "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -694,7 +724,7 @@ "h": 7, "w": 12, "x": 0, - "y": 28 + "y": 43 }, "hiddenSeries": false, "id": 2, @@ -716,7 +746,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -801,7 +831,6 @@ "description": "Note that if Control Plane does not sent FIN segment, Dataplanes can still think that connection is up waiting for new update even that Control Plane is down.", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -812,7 +841,7 @@ "h": 7, "w": 12, "x": 12, - "y": 28 + "y": 43 }, "hiddenSeries": false, "id": 3, @@ -834,7 +863,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -916,7 +945,6 @@ "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -927,7 +955,7 @@ "h": 8, "w": 12, "x": 0, - "y": 35 + "y": 50 }, "hiddenSeries": false, "id": 5, @@ -947,7 +975,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -1016,7 +1044,6 @@ "datasource": "Prometheus", "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -1027,7 +1054,7 @@ "h": 8, "w": 12, "x": 12, - "y": 35 + "y": 50 }, "hiddenSeries": false, "id": 7, @@ -1051,7 +1078,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.3", + "pluginVersion": "8.1.2", "pointradius": 2, "points": false, "renderer": "flot", @@ -1146,7 +1173,7 @@ } ], "refresh": "5s", - "schemaVersion": 27, + "schemaVersion": 30, "style": "dark", "tags": [], "templating": { @@ -1177,7 +1204,6 @@ "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", - "tags": [], "tagsQuery": "", "type": "query", "useTags": false