diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index f74d975a3c7f9..e1e3c5714f39b 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -24,7 +24,6 @@ jobs: - cni-plugin - controller - debug - - grafana - jaeger-webhook - metrics-api - policy-controller diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5e162e12d5b2..de55e39079249 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,6 @@ jobs: - cni-plugin - controller - debug - - grafana - jaeger-webhook - metrics-api - proxy diff --git a/BUILD.md b/BUILD.md index 1a83d048a3366..e796b2e982cc9 100644 --- a/BUILD.md +++ b/BUILD.md @@ -367,8 +367,6 @@ To develop with a webpack dev server: - `web` on :7777. This is the golang process that serves the dashboard. - `webpack-dev-server` on :8080 to manage rebuilding/reloading of the javascript. - - `grafana` is port-forwarded from the Kubernetes cluster via `kubectl` on - :3000 - `metrics-api` is port-forwarded from the Kubernetes cluster via `kubectl` on :8085 diff --git a/bin/_docker.sh b/bin/_docker.sh index 483467ea196cb..b475ffc544989 100644 --- a/bin/_docker.sh +++ b/bin/_docker.sh @@ -35,7 +35,6 @@ export DOCKER_IMAGES=(${DOCKER_IMAGES:- policy-controller metrics-api debug - grafana proxy web jaeger-webhook diff --git a/bin/_test-helpers.sh b/bin/_test-helpers.sh index 1c66727ab2d1e..8f43b9b695118 100644 --- a/bin/_test-helpers.sh +++ b/bin/_test-helpers.sh @@ -9,7 +9,7 @@ set +e export default_test_names=(deep external-issuer external-prometheus-deep helm-deep helm-upgrade uninstall upgrade-edge upgrade-stable default-policy-deny) export external_resource_test_names=(external-resources) export all_test_names=(cluster-domain cni-calico-deep multicluster "${default_test_names[*]}" "${external_resource_test_names[*]}") -images_load_default=(proxy controller policy-controller web metrics-api grafana tap) +images_load_default=(proxy controller policy-controller web metrics-api tap) tests_usage() { progname="${0##*/}" diff --git a/bin/docker-build b/bin/docker-build index a8219e04744a0..853c3b3ed3fc2 100755 --- a/bin/docker-build +++ b/bin/docker-build @@ -20,7 +20,6 @@ if [ -z "${LINKERD_LOCAL_BUILD_CLI:-}" ]; then else "$bindir"/build-cli-bin fi -"$bindir"/docker-build-grafana "$bindir"/docker-build-jaeger-webhook "$bindir"/docker-build-metrics-api "$bindir"/docker-build-tap diff --git a/bin/docker-build-grafana b/bin/docker-build-grafana deleted file mode 100755 index 1ed794ce2e78b..0000000000000 --- a/bin/docker-build-grafana +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -set -eu - -if [ $# -ne 0 ]; then - echo "no arguments allowed for ${0##*/}, given: $*" >&2 - exit 64 -fi - -bindir=$( cd "${BASH_SOURCE[0]%/*}" && pwd ) -rootdir=$( cd "$bindir"/.. && pwd ) - -# shellcheck source=_docker.sh -. "$bindir"/_docker.sh -# shellcheck source=_tag.sh -. "$bindir"/_tag.sh - -dockerfile=$rootdir/grafana/Dockerfile - -docker_build grafana "${TAG:-$(head_root_tag)}" "$dockerfile" diff --git a/bin/web b/bin/web index 9e4b96418ef8b..f7b9077ba66eb 100755 --- a/bin/web +++ b/bin/web @@ -26,17 +26,11 @@ USAGE check-for-linkerd-and-viz() { metrics_api_pod=$(get-pod linkerd-viz metrics-api) - grafana_pod=$(get-pod linkerd-viz grafana) if [[ -z "${metrics_api_pod// }" ]]; then err 'Metrics-api is not running. Have you installed Linkerd-Viz?' exit 1 fi - - if [[ -z "${grafana_pod// }" ]]; then - err 'Grafana is not running. Have you installed Linkerd-Viz?' - exit 1 - fi } dev() { @@ -104,7 +98,6 @@ run() { check-for-linkerd-and-viz && ( port-forward linkerd-viz metrics-api 8085 & - port-forward linkerd-viz grafana 3000 & ) cd "$ROOT"/web && \ diff --git a/cli/cmd/testdata/install_controlplane_tracing_output.golden b/cli/cmd/testdata/install_controlplane_tracing_output.golden index 890f1ab6d228f..b870545f747d7 100644 --- a/cli/cmd/testdata/install_controlplane_tracing_output.golden +++ b/cli/cmd/testdata/install_controlplane_tracing_output.golden @@ -1114,7 +1114,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: false - grafanaUrl: "" heartbeatResources: null heartbeatSchedule: 1 2 3 4 5 highAvailability: false diff --git a/cli/cmd/testdata/install_custom_domain.golden b/cli/cmd/testdata/install_custom_domain.golden index dd8bb50247e83..0b7d95508cb9e 100644 --- a/cli/cmd/testdata/install_custom_domain.golden +++ b/cli/cmd/testdata/install_custom_domain.golden @@ -1114,7 +1114,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: false - grafanaUrl: "" heartbeatResources: null heartbeatSchedule: 1 2 3 4 5 highAvailability: false diff --git a/cli/cmd/testdata/install_custom_registry.golden b/cli/cmd/testdata/install_custom_registry.golden index e0b5d0b879e5f..c3521f0ff6527 100644 --- a/cli/cmd/testdata/install_custom_registry.golden +++ b/cli/cmd/testdata/install_custom_registry.golden @@ -1114,7 +1114,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: false - grafanaUrl: "" heartbeatResources: null heartbeatSchedule: 1 2 3 4 5 highAvailability: false diff --git a/cli/cmd/testdata/install_default.golden b/cli/cmd/testdata/install_default.golden index dd8bb50247e83..0b7d95508cb9e 100644 --- a/cli/cmd/testdata/install_default.golden +++ b/cli/cmd/testdata/install_default.golden @@ -1114,7 +1114,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: false - grafanaUrl: "" heartbeatResources: null heartbeatSchedule: 1 2 3 4 5 highAvailability: false diff --git a/cli/cmd/testdata/install_default_override_dst_get_nets.golden b/cli/cmd/testdata/install_default_override_dst_get_nets.golden index 7cce0b2728faa..8acfcd8284970 100644 --- a/cli/cmd/testdata/install_default_override_dst_get_nets.golden +++ b/cli/cmd/testdata/install_default_override_dst_get_nets.golden @@ -1114,7 +1114,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: false - grafanaUrl: "" heartbeatResources: null heartbeatSchedule: 1 2 3 4 5 highAvailability: false diff --git a/cli/cmd/testdata/install_default_token.golden b/cli/cmd/testdata/install_default_token.golden index 240ddc706189e..a8791a0111676 100644 --- a/cli/cmd/testdata/install_default_token.golden +++ b/cli/cmd/testdata/install_default_token.golden @@ -1114,7 +1114,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: false - grafanaUrl: "" heartbeatResources: null heartbeatSchedule: 1 2 3 4 5 highAvailability: false diff --git a/cli/cmd/testdata/install_ha_output.golden b/cli/cmd/testdata/install_ha_output.golden index 55deadfc53775..a86a8f234a8a6 100644 --- a/cli/cmd/testdata/install_ha_output.golden +++ b/cli/cmd/testdata/install_ha_output.golden @@ -1123,7 +1123,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: true - grafanaUrl: "" heartbeatResources: cpu: limit: "" diff --git a/cli/cmd/testdata/install_ha_with_overrides_output.golden b/cli/cmd/testdata/install_ha_with_overrides_output.golden index 4104887e1a6f0..c807d70768246 100644 --- a/cli/cmd/testdata/install_ha_with_overrides_output.golden +++ b/cli/cmd/testdata/install_ha_with_overrides_output.golden @@ -1123,7 +1123,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: true - grafanaUrl: "" heartbeatResources: cpu: limit: "" diff --git a/cli/cmd/testdata/install_heartbeat_disabled_output.golden b/cli/cmd/testdata/install_heartbeat_disabled_output.golden index 886d4774ea953..5e48b7ebd7ddf 100644 --- a/cli/cmd/testdata/install_heartbeat_disabled_output.golden +++ b/cli/cmd/testdata/install_heartbeat_disabled_output.golden @@ -1045,7 +1045,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: false - grafanaUrl: "" heartbeatResources: null heartbeatSchedule: 1 2 3 4 5 highAvailability: false diff --git a/cli/cmd/testdata/install_helm_control_plane_output.golden b/cli/cmd/testdata/install_helm_control_plane_output.golden index 6911f37ec2d2b..83a52f55b0100 100644 --- a/cli/cmd/testdata/install_helm_control_plane_output.golden +++ b/cli/cmd/testdata/install_helm_control_plane_output.golden @@ -404,7 +404,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: false - grafanaUrl: "" heartbeatResources: null heartbeatSchedule: 1 2 3 4 5 highAvailability: false diff --git a/cli/cmd/testdata/install_helm_control_plane_output_ha.golden b/cli/cmd/testdata/install_helm_control_plane_output_ha.golden index 0848bc33c1222..2ca7362ed125e 100644 --- a/cli/cmd/testdata/install_helm_control_plane_output_ha.golden +++ b/cli/cmd/testdata/install_helm_control_plane_output_ha.golden @@ -413,7 +413,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: true - grafanaUrl: "" heartbeatResources: cpu: limit: "" diff --git a/cli/cmd/testdata/install_helm_output_ha_labels.golden b/cli/cmd/testdata/install_helm_output_ha_labels.golden index 46b52ddca731e..5225e752382c6 100644 --- a/cli/cmd/testdata/install_helm_output_ha_labels.golden +++ b/cli/cmd/testdata/install_helm_output_ha_labels.golden @@ -413,7 +413,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: true - grafanaUrl: "" heartbeatResources: cpu: limit: "" diff --git a/cli/cmd/testdata/install_helm_output_ha_namespace_selector.golden b/cli/cmd/testdata/install_helm_output_ha_namespace_selector.golden index 159c2c7d3c261..f9ac619fc45d1 100644 --- a/cli/cmd/testdata/install_helm_output_ha_namespace_selector.golden +++ b/cli/cmd/testdata/install_helm_output_ha_namespace_selector.golden @@ -413,7 +413,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: true - grafanaUrl: "" heartbeatResources: cpu: limit: "" diff --git a/cli/cmd/testdata/install_no_init_container.golden b/cli/cmd/testdata/install_no_init_container.golden index 1d4decb99459e..b5a02248192f4 100644 --- a/cli/cmd/testdata/install_no_init_container.golden +++ b/cli/cmd/testdata/install_no_init_container.golden @@ -1114,7 +1114,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: false - grafanaUrl: "" heartbeatResources: null heartbeatSchedule: 1 2 3 4 5 highAvailability: false diff --git a/cli/cmd/testdata/install_output.golden b/cli/cmd/testdata/install_output.golden index 87f86d8a88454..f79bce2c6cda8 100644 --- a/cli/cmd/testdata/install_output.golden +++ b/cli/cmd/testdata/install_output.golden @@ -1111,7 +1111,6 @@ data: enableEndpointSlices: false enableH2Upgrade: true enablePodAntiAffinity: false - grafanaUrl: "" heartbeatResources: null heartbeatSchedule: 1 2 3 4 5 highAvailability: false diff --git a/cli/cmd/testdata/install_proxy_ignores.golden b/cli/cmd/testdata/install_proxy_ignores.golden index 07acfb70c8b25..f04576139639f 100644 --- a/cli/cmd/testdata/install_proxy_ignores.golden +++ b/cli/cmd/testdata/install_proxy_ignores.golden @@ -1114,7 +1114,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: false - grafanaUrl: "" heartbeatResources: null heartbeatSchedule: 1 2 3 4 5 highAvailability: false diff --git a/cli/cmd/testdata/install_values_file.golden b/cli/cmd/testdata/install_values_file.golden index e4775ccc704b6..ec1397e5df3a3 100644 --- a/cli/cmd/testdata/install_values_file.golden +++ b/cli/cmd/testdata/install_values_file.golden @@ -1114,7 +1114,6 @@ data: enableEndpointSlices: true enableH2Upgrade: true enablePodAntiAffinity: false - grafanaUrl: "" heartbeatResources: null heartbeatSchedule: 1 2 3 4 5 highAvailability: false diff --git a/grafana/Dockerfile b/grafana/Dockerfile deleted file mode 100644 index 28a3e39ef401d..0000000000000 --- a/grafana/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM grafana/grafana:7.1.5 - -COPY LICENSE /linkerd/LICENSE -COPY grafana/dashboards /var/lib/grafana/dashboards -COPY grafana/dashboards/top-line.json /usr/share/grafana/public/dashboards/home.json diff --git a/grafana/README.md b/grafana/README.md new file mode 100644 index 0000000000000..0d27ebcce637a --- /dev/null +++ b/grafana/README.md @@ -0,0 +1,43 @@ +# Using Grafana with Linkerd + +You can install Grafana in various ways, like using the [Grafana official Helm +chart](https://github.com/grafana/helm-charts/tree/main/charts/grafana), or the +[Grafana Operator](https://github.com/grafana-operator/grafana-operator). Hosted +solutions are also available, like [Grafana +Cloud](https://grafana.com/products/cloud/). + +The file `grafana/values.yaml` provides a default Helm config for the [Grafana +official Helm +chart](https://github.com/grafana/helm-charts/tree/main/charts/grafana), which +pulls the Linkerd dashboards published at +. + +You can install the chart like this: + +```shell +helm repo add grafana https://grafana.github.io/helm-charts +helm install grafana -n grafana --create-namespace grafana/grafana \ + -f https://raw.githubusercontent.com/linkerd/linkerd2/main/grafana/values.yaml +``` + +Please make sure to update the entries in `grafana/values.yaml` before using the +file; in particular: + +- auth and log settings under `grafana.ini` +- `datasources.datasources.yaml.datasources[0].url` should point to your + Prometheus service + +The other installation methods can easily import those same dashboards using +their IDs, as listed in `grafana/values.yaml`. + +In order to have the Linkerd Viz Dashboard show the Grafana icon there where +relevant, and have it link to the appropriate Grafana dashboard, make sure you +have a proper location set up in the `grafana.url` setting in Linkerd Viz's +`values.yaml`. + +## Note to developers + +The `grafana/dashboards` directory contains the same dashboard definitions +published under . Please keep them in sync when +making any changes. After logging into grafana.com (using the linkerd account), +the dashboards can be managed under Org Settings -> My Dashboards. diff --git a/grafana/dashboards/authority.json b/grafana/dashboards/authority.json index a02bea67cb9a9..9c06a8b1b22b9 100644 --- a/grafana/dashboards/authority.json +++ b/grafana/dashboards/authority.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/cronjob.json b/grafana/dashboards/cronjob.json index 2aabdf6ea9931..e646ec424254b 100644 --- a/grafana/dashboards/cronjob.json +++ b/grafana/dashboards/cronjob.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/daemonset.json b/grafana/dashboards/daemonset.json index 3d8db5a5b06e7..b9d85e3296bb0 100644 --- a/grafana/dashboards/daemonset.json +++ b/grafana/dashboards/daemonset.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/deployment.json b/grafana/dashboards/deployment.json index 5a972c06747e5..97234c6e69350 100644 --- a/grafana/dashboards/deployment.json +++ b/grafana/dashboards/deployment.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/grafana.json b/grafana/dashboards/grafana.json deleted file mode 100644 index 2012d3768888f..0000000000000 --- a/grafana/dashboards/grafana.json +++ /dev/null @@ -1,1082 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "description": "Metrics about Grafana", - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": null, - "links": [ - { - "icon": "external link", - "tags": [], - "targetBlank": true, - "title": "Available metrics", - "type": "link", - "url": "/metrics" - }, - { - "icon": "external link", - "tags": [], - "title": "Grafana docs", - "type": "link", - "url": "http://docs.grafana.org/" - }, - { - "icon": "external link", - "tags": [], - "title": "Prometheus docs", - "type": "link", - "url": "http://prometheus.io/docs/introduction/overview/" - } - ], - "panels": [ - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "rgba(222, 3, 3, 0.9)", - "rgb(234, 245, 234)", - "rgb(235, 244, 235)" - ], - "datasource": "prometheus", - "decimals": 0, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 5, - "w": 4, - "x": 0, - "y": 0 - }, - "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, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "up{job=\"grafana\"}", - "format": "time_series", - "instant": true, - "intervalFactor": 2, - "refId": "A", - "step": 60 - } - ], - "thresholds": "1, 10000", - "title": "Active instances", - "type": "singlestat", - "valueFontSize": "120%", - "valueMaps": [ - { - "op": "=", - "text": ":(", - "value": "0" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "prometheus", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 5, - "w": 4, - "x": 4, - "y": 0 - }, - "id": 8, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "grafana_stat_totals_dashboard", - "format": "time_series", - "instant": true, - "intervalFactor": 2, - "refId": "A", - "step": 60 - } - ], - "thresholds": "", - "title": "Dashboard count", - "type": "singlestat", - "valueFontSize": "120%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "prometheus", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 5, - "w": 4, - "x": 8, - "y": 0 - }, - "id": 9, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "grafana_stat_total_users", - "format": "time_series", - "instant": true, - "intervalFactor": 2, - "refId": "A", - "step": 60 - } - ], - "thresholds": "", - "title": "User count", - "type": "singlestat", - "valueFontSize": "120%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "prometheus", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 5, - "w": 4, - "x": 12, - "y": 0 - }, - "id": 10, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "grafana_stat_total_playlists", - "format": "time_series", - "instant": true, - "intervalFactor": 2, - "refId": "A", - "step": 60 - } - ], - "thresholds": "", - "title": "Playlist count", - "type": "singlestat", - "valueFontSize": "120%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "columns": [], - "datasource": "prometheus", - "fontSize": "100%", - "gridPos": { - "h": 5, - "w": 4, - "x": 16, - "y": 0 - }, - "id": 17, - "links": [], - "options": {}, - "pageSize": null, - "scroll": false, - "showHeader": true, - "sort": { - "col": 0, - "desc": true - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "link": false, - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 0, - "pattern": "/.*/", - "thresholds": [], - "type": "number", - "unit": "short" - } - ], - "targets": [ - { - "expr": "topk(1, grafana_info)", - "format": "time_series", - "instant": true, - "intervalFactor": 2, - "legendFormat": "{{version}}", - "refId": "A", - "step": 20 - } - ], - "title": "Grafana version", - "transform": "timeseries_to_rows", - "type": "table" - }, - { - "content": "
\n
\n
\n\n💖\n\"Prometheus\n
", - "gridPos": { - "h": 5, - "w": 4, - "x": 20, - "y": 0 - }, - "id": 16, - "links": [], - "mode": "html", - "options": {}, - "title": "", - "transparent": true, - "type": "text" - }, - { - "aliasColors": { - "400": "#447EBC", - "500": "#BF1B00" - }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "gridPos": { - "h": 10, - "w": 10, - "x": 0, - "y": 5 - }, - "height": "", - "id": 15, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null as zero", - "options": {}, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - {} - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum by (statuscode) (irate(http_request_total{job='grafana'}[5m]))", - "format": "time_series", - "intervalFactor": 3, - "legendFormat": "{{statuscode}}", - "refId": "B", - "step": 15, - "target": "dev.grafana.cb-office.alerting.active_alerts" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "http status codes", - "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": { - "400": "#447EBC", - "500": "#BF1B00" - }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "gridPos": { - "h": 10, - "w": 10, - "x": 10, - "y": 5 - }, - "height": "", - "id": 11, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null as zero", - "options": {}, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - {} - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(irate(grafana_api_response_status_total[5m]))", - "format": "time_series", - "intervalFactor": 4, - "legendFormat": "api", - "refId": "A", - "step": 20 - }, - { - "expr": "sum(irate(grafana_proxy_response_status_total[5m]))", - "format": "time_series", - "intervalFactor": 4, - "legendFormat": "proxy", - "refId": "B", - "step": 20 - }, - { - "expr": "sum(irate(grafana_page_response_status_total[5m]))", - "format": "time_series", - "intervalFactor": 4, - "legendFormat": "web", - "refId": "C", - "step": 20 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Requests by routing group", - "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 - } - }, - { - "columns": [], - "datasource": "prometheus", - "fontSize": "100%", - "gridPos": { - "h": 10, - "w": 4, - "x": 20, - "y": 5 - }, - "height": "", - "id": 12, - "links": [], - "options": {}, - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 0, - "desc": true - }, - "styles": [ - { - "alias": "Time", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "link": false, - "pattern": "Time", - "type": "hidden" - }, - { - "alias": "", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 0, - "pattern": "/.*/", - "thresholds": [], - "type": "number", - "unit": "short" - } - ], - "targets": [ - { - "expr": "sort(topk(8, sum by (handler) (http_request_total{job=\"grafana\"})))", - "format": "time_series", - "instant": true, - "intervalFactor": 10, - "legendFormat": "{{handler}}", - "refId": "A", - "step": 100 - } - ], - "title": "Most used handlers", - "transform": "timeseries_to_rows", - "type": "table" - }, - { - "aliasColors": { - "alerting": "#890F02", - "ok": "#7EB26D" - }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "gridPos": { - "h": 5, - "w": 12, - "x": 0, - "y": 15 - }, - "id": 6, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": {}, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "increase(grafana_alerting_active_alerts[1m])", - "format": "time_series", - "intervalFactor": 3, - "legendFormat": "{{state}}", - "refId": "A", - "step": 15 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Grafana active alerts", - "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": { - "alerting": "#890F02", - "alertname": "#BF1B00", - "firing alerts": "#BF1B00", - "ok": "#7EB26D" - }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "prometheus", - "fill": 1, - "gridPos": { - "h": 5, - "w": 12, - "x": 12, - "y": 15 - }, - "id": 18, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": {}, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Firing alerts", - "yaxis": 1 - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": " sum (ALERTS)", - "format": "time_series", - "intervalFactor": 3, - "legendFormat": "firing alerts", - "refId": "A", - "step": 15 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Prometheus alerts", - "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": "prometheus", - "description": "Aggregated over all Grafana nodes.", - "fill": 1, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 20 - }, - "id": 7, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null", - "options": {}, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "avg gc duration", - "yaxis": 2 - }, - { - "alias": "127.0.0.1:3000", - "yaxis": 1 - }, - { - "alias": "allocated memory", - "yaxis": 2 - }, - { - "alias": "used memory", - "yaxis": 2 - }, - { - "alias": "memory usage", - "yaxis": 2 - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(go_goroutines{job=\"grafana\"})", - "format": "time_series", - "hide": false, - "intervalFactor": 4, - "legendFormat": "go routines", - "refId": "A", - "step": 8, - "target": "select metric", - "type": "timeserie" - }, - { - "expr": "sum(process_resident_memory_bytes{job=\"grafana\"})", - "format": "time_series", - "intervalFactor": 4, - "legendFormat": "memory usage", - "refId": "B", - "step": 8 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Grafana performance", - "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": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "content": "
\n
\n \n
\n
\n
\n
\n", - "gridPos": { - "h": 3, - "w": 24, - "x": 0, - "y": 27 - }, - "height": "1px", - "id": 171, - "links": [], - "mode": "html", - "options": {}, - "title": "", - "transparent": true, - "type": "text" - } - ], - "revision": "1.0", - "schemaVersion": 18, - "style": "dark", - "tags": [ - "grafana", - "prometheus" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-6h", - "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": "Grafana metrics", - "uid": "grafana-metrics", - "version": 1 -} diff --git a/grafana/dashboards/health.json b/grafana/dashboards/health.json index 6e2f6f7b1e039..ed0a8e5e401f1 100644 --- a/grafana/dashboards/health.json +++ b/grafana/dashboards/health.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/job.json b/grafana/dashboards/job.json index f5b64aeab4223..1765af1f45530 100644 --- a/grafana/dashboards/job.json +++ b/grafana/dashboards/job.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/kubernetes.json b/grafana/dashboards/kubernetes.json index 710b5175a6cab..9b5a4ee253d31 100644 --- a/grafana/dashboards/kubernetes.json +++ b/grafana/dashboards/kubernetes.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { @@ -2244,4 +2291,4 @@ "title": "Kubernetes cluster monitoring (via Prometheus)", "uid": "k8s", "version": 1 -} \ No newline at end of file +} diff --git a/grafana/dashboards/multicluster.json b/grafana/dashboards/multicluster.json index d473f238885ee..aca0b5e6bb661 100644 --- a/grafana/dashboards/multicluster.json +++ b/grafana/dashboards/multicluster.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/namespace.json b/grafana/dashboards/namespace.json index 3d6a459ab02f6..e0c56b63217ac 100644 --- a/grafana/dashboards/namespace.json +++ b/grafana/dashboards/namespace.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/pod.json b/grafana/dashboards/pod.json index 1f99773c33600..d66378319daeb 100644 --- a/grafana/dashboards/pod.json +++ b/grafana/dashboards/pod.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/prometheus-benchmark.json b/grafana/dashboards/prometheus-benchmark.json index d05cf1e75f0f0..09b8631da92a6 100644 --- a/grafana/dashboards/prometheus-benchmark.json +++ b/grafana/dashboards/prometheus-benchmark.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/prometheus.json b/grafana/dashboards/prometheus.json index fe9dad4cbf9e4..ec881687eee41 100644 --- a/grafana/dashboards/prometheus.json +++ b/grafana/dashboards/prometheus.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/replicaset.json b/grafana/dashboards/replicaset.json index 6c92e1d184a2a..87e787913aa15 100644 --- a/grafana/dashboards/replicaset.json +++ b/grafana/dashboards/replicaset.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/replicationcontroller.json b/grafana/dashboards/replicationcontroller.json index df3db574dc8de..318359d55c731 100644 --- a/grafana/dashboards/replicationcontroller.json +++ b/grafana/dashboards/replicationcontroller.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/route.json b/grafana/dashboards/route.json index 3e6ea96a3015f..60223f308a49c 100644 --- a/grafana/dashboards/route.json +++ b/grafana/dashboards/route.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { @@ -1259,4 +1306,4 @@ "uid": "route", "version": 1 } - \ No newline at end of file + diff --git a/grafana/dashboards/service.json b/grafana/dashboards/service.json index db517460f77d4..378e75fa12aa0 100644 --- a/grafana/dashboards/service.json +++ b/grafana/dashboards/service.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/statefulset.json b/grafana/dashboards/statefulset.json index f699912b97106..13a82730ce66f 100644 --- a/grafana/dashboards/statefulset.json +++ b/grafana/dashboards/statefulset.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/dashboards/top-line.json b/grafana/dashboards/top-line.json index d9181a2b64b7f..1d3c1deaf979b 100644 --- a/grafana/dashboards/top-line.json +++ b/grafana/dashboards/top-line.json @@ -1,4 +1,51 @@ { + "__inputs": [ + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { diff --git a/grafana/values.yaml b/grafana/values.yaml new file mode 100644 index 0000000000000..3ff2ee39f7492 --- /dev/null +++ b/grafana/values.yaml @@ -0,0 +1,125 @@ +podAnnotations: + linkerd.io/inject: enabled + +grafana.ini: + server: + root_url: '%(protocol)s://%(domain)s:/grafana/' + auth: + disable_login_form: true + auth.anonymous: + enabled: true + org_role: Editor + auth.basic: + enabled: false + analytics: + check_for_updates: false + panels: + disable_sanitize_html: true + log: + mode: console + log.console: + format: text + level: info + +datasources: + datasources.yaml: + apiVersion: 1 + datasources: + - name: prometheus + type: prometheus + access: proxy + orgId: 1 + url: http://prometheus.linkerd-viz.svc.cluster.local:9090 + isDefault: true + jsonData: + timeInterval: "5s" + editable: true + +dashboardProviders: + dashboardproviders.yaml: + apiVersion: 1 + providers: + - name: 'default' + orgId: 1 + folder: '' + type: file + disableDeletion: false + editable: true + options: + path: /var/lib/grafana/dashboards/default + +dashboards: + default: + # all these charts are hosted at https://grafana.com/grafana/dashboards/{id} + top-line: + gnetId: 15474 + revision: 2 + datasource: prometheus + health: + gnetId: 15486 + revision: 1 + datasource: prometheus + kubernetes: + gnetId: 15479 + revision: 1 + datasource: prometheus + namespace: + gnetId: 15478 + revision: 1 + datasource: prometheus + deployment: + gnetId: 15475 + revision: 2 + datasource: prometheus + pod: + gnetId: 15477 + revision: 1 + datasource: prometheus + service: + gnetId: 15480 + revision: 1 + datasource: prometheus + route: + gnetId: 15481 + revision: 1 + datasource: prometheus + authority: + gnetId: 15482 + revision: 1 + datasource: prometheus + cronjob: + gnetId: 15483 + revision: 1 + datasource: prometheus + job: + gnetId: 15487 + revision: 1 + datasource: prometheus + daemonset: + gnetId: 15484 + revision: 1 + datasource: prometheus + replicaset: + gnetId: 15491 + revision: 1 + datasource: prometheus + statefulset: + gnetId: 15493 + revision: 1 + datasource: prometheus + replicationcontroller: + gnetId: 15492 + revision: 1 + datasource: prometheus + prometheus: + gnetId: 15489 + revision: 1 + datasource: prometheus + prometheus-benchmark: + gnetId: 15490 + revision: 1 + datasource: prometheus + multicluster: + gnetId: 15488 + revision: 1 + datasource: prometheus diff --git a/pkg/charts/linkerd2/values.go b/pkg/charts/linkerd2/values.go index eaa6477a275d0..a29c4ffe90c76 100644 --- a/pkg/charts/linkerd2/values.go +++ b/pkg/charts/linkerd2/values.go @@ -51,7 +51,6 @@ type ( IdentityTrustAnchorsPEM string `json:"identityTrustAnchorsPEM"` IdentityTrustDomain string `json:"identityTrustDomain"` PrometheusURL string `json:"prometheusUrl"` - GrafanaURL string `json:"grafanaUrl"` ImagePullSecrets []map[string]string `json:"imagePullSecrets"` LinkerdVersion string `json:"linkerdVersion"` diff --git a/pkg/healthcheck/healthcheck_test.go b/pkg/healthcheck/healthcheck_test.go index 7ec99bd250674..0367bb6bba01b 100644 --- a/pkg/healthcheck/healthcheck_test.go +++ b/pkg/healthcheck/healthcheck_test.go @@ -1368,7 +1368,6 @@ func TestValidateControlPlanePods(t *testing.T) { t.Run("Returns an error if not all pods are running", func(t *testing.T) { pods := []corev1.Pod{ - pod("linkerd-grafana-5b7d796646-hh46d", corev1.PodRunning, true), pod("linkerd-destination-9849948665-37082", corev1.PodFailed, true), pod("linkerd-identity-6849948664-27982", corev1.PodFailed, true), } @@ -2219,7 +2218,6 @@ data: controllerImageVersion: ControllerImageVersion controllerLogLevel: ControllerLogLevel enableEndpointSlices: false - grafanaUrl: "" highAvailability: false imagePullPolicy: ImagePullPolicy imagePullSecrets: null @@ -2376,7 +2374,6 @@ data: controllerImageVersion: ControllerImageVersion controllerLogLevel: ControllerLogLevel enableEndpointSlices: false - grafanaUrl: "" highAvailability: false imagePullPolicy: ImagePullPolicy imagePullSecrets: null diff --git a/test/integration/install_test.go b/test/integration/install_test.go index 5d9a36a74f3c0..9647138703545 100644 --- a/test/integration/install_test.go +++ b/test/integration/install_test.go @@ -43,7 +43,6 @@ var ( linkerdSvcEdge = []testutil.Service{ {Namespace: "linkerd", Name: "linkerd-dst"}, - {Namespace: "linkerd-viz", Name: "grafana"}, {Namespace: "linkerd", Name: "linkerd-identity"}, {Namespace: "linkerd-viz", Name: "web"}, {Namespace: "linkerd-viz", Name: "tap"}, @@ -452,7 +451,10 @@ func TestInstallOrUpgradeCli(t *testing.T) { testutil.AnnotatedFatal(t, "'linkerd viz install' command failed", err) } - out, err = TestHelper.KubectlApply(out, "") + out, err = TestHelper.KubectlApplyWithArgs(out, []string{ + "--prune", + "-l", "linkerd.io/extension=viz", + }...) if err != nil { testutil.AnnotatedFatalf(t, "'kubectl apply' command failed", "'kubectl apply' command failed\n%s", out) @@ -510,7 +512,6 @@ func helmOverridesEdge(root *tls.CA) ([]string, []string) { "--set", "tap.image.registry="+override, "--set", "tapInjector.image.registry="+override, "--set", "dashboard.image.registry="+override, - "--set", "grafana.image.registry="+override, ) } diff --git a/test/integration/routes/routes_test.go b/test/integration/routes/routes_test.go index 735af2e54628c..5e89212b3e2ac 100644 --- a/test/integration/routes/routes_test.go +++ b/test/integration/routes/routes_test.go @@ -62,7 +62,6 @@ func TestRoutes(t *testing.T) { } vizRouteStrings := []testCase{ - {"grafana", 13}, {"metrics-api", 9}, {"tap", 4}, {"tap-injector", 2}, diff --git a/test/integration/stat/stat_test.go b/test/integration/stat/stat_test.go index 2d471ea7e35f8..925c2e853cab8 100644 --- a/test/integration/stat/stat_test.go +++ b/test/integration/stat/stat_test.go @@ -140,7 +140,6 @@ func TestCliStatForLinkerdNamespace(t *testing.T) { args: []string{"viz", "stat", "deploy", "-n", TestHelper.GetVizNamespace()}, expectedRows: map[string]string{ "metrics-api": "1/1", - "grafana": "1/1", "prometheus": "1/1", "tap": "1/1", "web": "1/1", @@ -150,7 +149,7 @@ func TestCliStatForLinkerdNamespace(t *testing.T) { { args: []string{"viz", "stat", "ns", TestHelper.GetVizNamespace()}, expectedRows: map[string]string{ - TestHelper.GetVizNamespace(): "6/6", + TestHelper.GetVizNamespace(): "5/5", }, }, { @@ -172,7 +171,6 @@ func TestCliStatForLinkerdNamespace(t *testing.T) { args: []string{"viz", "stat", "deploy", "-n", TestHelper.GetVizNamespace()}, expectedRows: map[string]string{ "metrics-api": "1/1", - "grafana": "1/1", "tap": "1/1", "web": "1/1", "tap-injector": "1/1", @@ -181,7 +179,7 @@ func TestCliStatForLinkerdNamespace(t *testing.T) { { args: []string{"viz", "stat", "ns", TestHelper.GetVizNamespace()}, expectedRows: map[string]string{ - TestHelper.GetVizNamespace(): "5/5", + TestHelper.GetVizNamespace(): "4/4", }, }, }..., diff --git a/test/integration/testdata/external_prometheus.yaml b/test/integration/testdata/external_prometheus.yaml index af557fdd25e19..4af8efe32cf64 100644 --- a/test/integration/testdata/external_prometheus.yaml +++ b/test/integration/testdata/external_prometheus.yaml @@ -62,7 +62,7 @@ data: kubernetes_sd_configs: - role: pod namespaces: - names: ['linkerd'] + names: ['grafana'] relabel_configs: - source_labels: - __meta_kubernetes_pod_container_name diff --git a/testutil/test_helper.go b/testutil/test_helper.go index f342a32258292..3312c2a6079b4 100644 --- a/testutil/test_helper.go +++ b/testutil/test_helper.go @@ -85,7 +85,6 @@ var LinkerdDeployReplicasStable = LinkerdDeployReplicasEdge var LinkerdVizDeployReplicas = map[string]DeploySpec{ "prometheus": {"linkerd-viz", 1}, "metrics-api": {"linkerd-viz", 1}, - "grafana": {"linkerd-viz", 1}, "tap": {"linkerd-viz", 1}, "tap-injector": {"linkerd-viz", 1}, "web": {"linkerd-viz", 1}, diff --git a/viz/charts/linkerd-viz/README.md b/viz/charts/linkerd-viz/README.md index 9083d7543c289..ce403eaa5522a 100644 --- a/viz/charts/linkerd-viz/README.md +++ b/viz/charts/linkerd-viz/README.md @@ -96,23 +96,7 @@ Kubernetes: `>=1.20.0-0` | defaultUID | int | `2103` | UID for all the viz components | | enablePSP | bool | `false` | Create Roles and RoleBindings to associate this extension's ServiceAccounts to the control plane PSP resource. This requires that `enabledPSP` is set to true on the control plane install. Note PSP has been deprecated since k8s v1.21 | | enablePodAntiAffinity | bool | `false` | Enables Pod Anti Affinity logic to balance the placement of replicas across hosts and zones for High Availability. Enable this only when you have multiple replicas of components. | -| grafana.enabled | bool | `true` | toggle field to enable or disable grafana | -| grafana.image.name | string | `"grafana"` | Docker image name for the grafana instance | -| grafana.image.pullPolicy | string | defaultImagePullPolicy | Pull policy for the grafana instance | -| grafana.image.registry | string | defaultRegistry | Docker registry for the grafana instance | -| grafana.image.tag | string | linkerdVersion | Docker image tag for the grafana instance | -| grafana.logFormat | string | defaultLogFormat | log format (plain, json) of the grafana instance | -| grafana.logLevel | string | defaultLogLevel | log level of the grafana instance | -| grafana.nodeSelector | object | `{"kubernetes.io/os":"linux"}` | NodeSelector section, See the [K8S documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) for more information | -| grafana.proxy | string | `nil` | | -| grafana.resources.cpu.limit | string | `nil` | Maximum amount of CPU units that the grafana container can use | -| grafana.resources.cpu.request | string | `nil` | Amount of CPU units that the grafana container requests | -| grafana.resources.ephemeral-storage.limit | string | `""` | Maximum amount of ephemeral storage that the grafana container can use | -| grafana.resources.ephemeral-storage.request | string | `""` | Amount of ephemeral storage that the grafana container requests | -| grafana.resources.memory.limit | string | `nil` | Maximum amount of memory that grafana container can use | -| grafana.resources.memory.request | string | `nil` | Amount of memory that the grafana container requests | -| grafana.tolerations | string | `nil` | Tolerations section, See the [K8S documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) for more information | -| grafanaUrl | string | `""` | url of external grafana instance with reverse proxy configured. | +| grafana.url | string | `nil` | url of a Grafana instance with reverse proxy configured, used by the Linkerd viz web dashboard to provide direct links to specific Grafana dashboards. See the [Linkerd documentation](https://linkerd.io/2/tasks/grafana) for more information | | identityTrustDomain | string | clusterDomain | Trust domain used for identity | | imagePullSecrets | list | `[]` | For Private docker registries, authentication is needed. Registry secrets are applied to the respective service accounts | | jaegerUrl | string | `""` | url of external jaeger instance Set this to `jaeger.linkerd-jaeger.svc.` if you plan to use jaeger extension | diff --git a/viz/charts/linkerd-viz/templates/grafana-policy.yaml b/viz/charts/linkerd-viz/templates/grafana-policy.yaml deleted file mode 100644 index ad5daf1d0241d..0000000000000 --- a/viz/charts/linkerd-viz/templates/grafana-policy.yaml +++ /dev/null @@ -1,37 +0,0 @@ -{{ if .Values.grafana.enabled -}} ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: Server -metadata: - {{ include "partials.namespace" . }} - name: grafana - labels: - linkerd.io/extension: viz - component: grafana - annotations: - {{ include "partials.annotations.created-by" . }} -spec: - podSelector: - matchLabels: - linkerd.io/extension: viz - component: grafana - port: http - proxyProtocol: HTTP/1 ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: ServerAuthorization -metadata: - {{ include "partials.namespace" . }} - name: grafana - labels: - linkerd.io/extension: viz - component: grafana - annotations: - {{ include "partials.annotations.created-by" . }} -spec: - server: - name: grafana - client: - # web, prometheus and the kubelet probes - unauthenticated: true -{{ end -}} diff --git a/viz/charts/linkerd-viz/templates/grafana-rbac.yaml b/viz/charts/linkerd-viz/templates/grafana-rbac.yaml deleted file mode 100644 index fe3f29013e67d..0000000000000 --- a/viz/charts/linkerd-viz/templates/grafana-rbac.yaml +++ /dev/null @@ -1,16 +0,0 @@ -{{ if .Values.grafana.enabled -}} ---- -### -### Grafana RBAC -### -kind: ServiceAccount -apiVersion: v1 -metadata: - name: grafana - {{ include "partials.namespace" . }} - labels: - linkerd.io/extension: viz - component: grafana - namespace: {{.Release.Namespace}} -{{- include "partials.image-pull-secrets" .Values.imagePullSecrets }} -{{ end -}} diff --git a/viz/charts/linkerd-viz/templates/grafana.yaml b/viz/charts/linkerd-viz/templates/grafana.yaml deleted file mode 100644 index 36fa85d404b33..0000000000000 --- a/viz/charts/linkerd-viz/templates/grafana.yaml +++ /dev/null @@ -1,181 +0,0 @@ -{{ if .Values.grafana.enabled -}} ---- -### -### Grafana -### -kind: ConfigMap -apiVersion: v1 -metadata: - name: grafana-config - {{ include "partials.namespace" . }} - labels: - linkerd.io/extension: viz - component: grafana - namespace: {{.Release.Namespace}} - annotations: - {{ include "partials.annotations.created-by" . }} -data: - grafana.ini: |- - instance_name = grafana - [server] - root_url = %(protocol)s://%(domain)s:/grafana/ - [auth] - disable_login_form = true - [auth.anonymous] - enabled = true - org_role = Editor - [auth.basic] - enabled = false - [analytics] - check_for_updates = false - [panels] - disable_sanitize_html = true - [log] - mode = console - [log.console] - format = {{ .Values.grafana.logFormat | default .Values.defaultLogFormat | replace "plain" "text" }} - level = {{ .Values.grafana.logLevel | default .Values.defaultLogLevel }} - datasources.yaml: |- - apiVersion: 1 - datasources: - - name: prometheus - type: prometheus - access: proxy - orgId: 1 - {{- if .Values.prometheusUrl }} - url: {{.Values.prometheusUrl}} - {{- else }} - url: http://prometheus.{{.Release.Namespace}}.svc.{{.Values.clusterDomain}}:9090 - {{- end }} - isDefault: true - jsonData: - timeInterval: "5s" - version: 1 - editable: true - - dashboards.yaml: |- - apiVersion: 1 - providers: - - name: 'default' - orgId: 1 - folder: '' - type: file - disableDeletion: true - editable: true - options: - path: /var/lib/grafana/dashboards - homeDashboardId: linkerd-top-line ---- -kind: Service -apiVersion: v1 -metadata: - name: grafana - {{ include "partials.namespace" . }} - labels: - linkerd.io/extension: viz - component: grafana - namespace: {{.Release.Namespace}} - annotations: - {{ include "partials.annotations.created-by" . }} - linkerd.io/inject: enabled -spec: - type: ClusterIP - selector: - linkerd.io/extension: viz - component: grafana - ports: - - name: http - port: 3000 - targetPort: 3000 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - {{ include "partials.annotations.created-by" . }} - linkerd.io/inject: enabled - config.linkerd.io/proxy-await: "enabled" - labels: - linkerd.io/extension: viz - app.kubernetes.io/name: grafana - app.kubernetes.io/part-of: Linkerd - app.kubernetes.io/version: {{default .Values.linkerdVersion .Values.cliVersion}} - component: grafana - namespace: {{.Release.Namespace}} - name: grafana - {{ include "partials.namespace" . }} -spec: - replicas: 1 - selector: - matchLabels: - linkerd.io/extension: viz - component: grafana - namespace: {{.Release.Namespace}} - template: - metadata: - annotations: - {{ include "partials.annotations.created-by" . }} - {{- with .Values.grafana.proxy }} - {{- include "partials.proxy.config.annotations" .resources | nindent 8 }} - {{- end }} - {{- with .Values.podAnnotations }}{{ toYaml . | trim | nindent 8 }}{{- end }} - linkerd.io/inject: enabled - labels: - linkerd.io/extension: viz - component: grafana - namespace: {{.Release.Namespace}} - {{- with .Values.podLabels }}{{ toYaml . | trim | nindent 8 }}{{- end }} - spec: - {{- if .Values.grafana.tolerations -}} - {{- include "linkerd.tolerations" (dict "Values" .Values.grafana) | nindent 6 }} - {{- end -}} - {{- include "linkerd.node-selector" (dict "Values" .Values.grafana) | nindent 6 }} - containers: - - env: - - name: GF_PATHS_DATA - value: /data - # Force using the go-based DNS resolver instead of the OS' to avoid failures in some environments - # see https://github.com/grafana/grafana/issues/20096 - - name: GODEBUG - value: netdns=go - image: {{.Values.grafana.image.registry | default .Values.defaultRegistry}}/{{.Values.grafana.image.name}}:{{.Values.grafana.image.tag | default .Values.linkerdVersion}} - imagePullPolicy: {{.Values.grafana.image.pullPolicy | default .Values.defaultImagePullPolicy}} - livenessProbe: - httpGet: - path: /api/health - port: 3000 - initialDelaySeconds: 30 - name: grafana - ports: - - containerPort: 3000 - name: http - readinessProbe: - httpGet: - path: /api/health - port: 3000 - {{- if .Values.grafana.resources -}} - {{- include "partials.resources" .Values.grafana.resources | nindent 8 }} - {{- end }} - securityContext: - runAsUser: 472 - volumeMounts: - - mountPath: /data - name: data - - mountPath: /etc/grafana - name: grafana-config - readOnly: true - serviceAccountName: grafana - volumes: - - emptyDir: {} - name: data - - configMap: - items: - - key: grafana.ini - path: grafana.ini - - key: datasources.yaml - path: provisioning/datasources/datasources.yaml - - key: dashboards.yaml - path: provisioning/dashboards/dashboards.yaml - name: grafana-config - name: grafana-config -{{ end -}} diff --git a/viz/charts/linkerd-viz/templates/prometheus.yaml b/viz/charts/linkerd-viz/templates/prometheus.yaml index 5c828f1fdcaeb..b03d8fc3fb8e9 100644 --- a/viz/charts/linkerd-viz/templates/prometheus.yaml +++ b/viz/charts/linkerd-viz/templates/prometheus.yaml @@ -30,19 +30,6 @@ data: static_configs: - targets: ['localhost:9090'] - {{ if .Values.grafana.enabled -}} - - job_name: 'grafana' - kubernetes_sd_configs: - - role: pod - namespaces: - names: ['{{.Release.Namespace}}'] - relabel_configs: - - source_labels: - - __meta_kubernetes_pod_container_name - action: keep - regex: ^grafana$ - {{- end }} - # Required for: https://grafana.com/grafana/dashboards/315 - job_name: 'kubernetes-nodes-cadvisor' scheme: https diff --git a/viz/charts/linkerd-viz/templates/psp.yaml b/viz/charts/linkerd-viz/templates/psp.yaml index 123a4ac3d7dcb..e6924d8e192a0 100644 --- a/viz/charts/linkerd-viz/templates/psp.yaml +++ b/viz/charts/linkerd-viz/templates/psp.yaml @@ -33,11 +33,6 @@ subjects: - kind: ServiceAccount name: web namespace: {{.Release.Namespace}} -{{ if .Values.grafana.enabled -}} -- kind: ServiceAccount - name: grafana - namespace: {{.Release.Namespace}} -{{ end -}} {{ if .Values.prometheus.enabled -}} - kind: ServiceAccount name: prometheus diff --git a/viz/charts/linkerd-viz/templates/service-profiles.yaml b/viz/charts/linkerd-viz/templates/service-profiles.yaml index d003792eba170..231d57d58c1bc 100644 --- a/viz/charts/linkerd-viz/templates/service-profiles.yaml +++ b/viz/charts/linkerd-viz/templates/service-profiles.yaml @@ -4,6 +4,8 @@ kind: ServiceProfile metadata: name: metrics-api.{{.Release.Namespace}}.svc.{{.Values.clusterDomain}} {{ include "partials.namespace" . }} + labels: + linkerd.io/extension: viz spec: routes: - name: POST /api/v1/StatSummary @@ -41,6 +43,8 @@ kind: ServiceProfile metadata: name: prometheus.{{.Release.Namespace}}.svc.{{.Values.clusterDomain}} {{ include "partials.namespace" . }} + labels: + linkerd.io/extension: viz spec: routes: - name: POST /api/v1/query @@ -56,57 +60,3 @@ spec: method: GET pathRegex: /api/v1/series {{ end -}} -{{ if .Values.grafana.enabled -}} ---- -apiVersion: linkerd.io/v1alpha2 -kind: ServiceProfile -metadata: - name: grafana.{{.Release.Namespace}}.svc.{{.Values.clusterDomain}} - {{ include "partials.namespace" . }} -spec: - routes: - - name: GET /api/annotations - condition: - method: GET - pathRegex: /api/annotations - - name: GET /api/dashboards/tags - condition: - method: GET - pathRegex: /api/dashboards/tags - - name: GET /api/dashboards/uid/{uid} - condition: - method: GET - pathRegex: /api/dashboards/uid/.* - - name: GET /api/dashboard/{dashboard} - condition: - method: GET - pathRegex: /api/dashboard/.* - - name: GET /api/datasources/proxy/1/api/v1/series - condition: - method: GET - pathRegex: /api/datasources/proxy/1/api/v1/series - - name: GET /api/datasources/proxy/1/api/v1/query_range - condition: - method: GET - pathRegex: /api/datasources/proxy/1/api/v1/query_range - - name: GET /api/search - condition: - method: GET - pathRegex: /api/search - - name: GET /d/{uid}/{dashboard-name} - condition: - method: GET - pathRegex: /d/[^/]*/.* - - name: GET /public/build/{style}.css - condition: - method: GET - pathRegex: /public/build/.*\.css - - name: GET /public/fonts/{font} - condition: - method: GET - pathRegex: /public/fonts/.* - - name: GET /public/img/{img} - condition: - method: GET - pathRegex: /public/img/.* -{{ end -}} diff --git a/viz/charts/linkerd-viz/templates/tap-injector-rbac.yaml b/viz/charts/linkerd-viz/templates/tap-injector-rbac.yaml index 2b75c6fe31ade..e2c0267f190f3 100644 --- a/viz/charts/linkerd-viz/templates/tap-injector-rbac.yaml +++ b/viz/charts/linkerd-viz/templates/tap-injector-rbac.yaml @@ -34,6 +34,8 @@ metadata: name: tap-injector {{ include "partials.namespace" . }} {{- include "partials.image-pull-secrets" .Values.imagePullSecrets }} + labels: + linkerd.io/extension: viz --- {{- $host := printf "tap-injector.%s.svc" .Release.Namespace }} {{- $ca := genSelfSignedCert $host (list) (list $host) 365 }} diff --git a/viz/charts/linkerd-viz/templates/web.yaml b/viz/charts/linkerd-viz/templates/web.yaml index 33ac564763a12..ac31d00bdf4ec 100644 --- a/viz/charts/linkerd-viz/templates/web.yaml +++ b/viz/charts/linkerd-viz/templates/web.yaml @@ -73,10 +73,8 @@ spec: - args: - -linkerd-metrics-api-addr=metrics-api.{{.Release.Namespace}}.svc.{{.Values.clusterDomain}}:8085 - -cluster-domain={{.Values.clusterDomain}} - {{- if .Values.grafanaUrl }} - - -grafana-addr={{.Values.grafanaUrl}} - {{- else if .Values.grafana.enabled }} - - -grafana-addr=grafana.{{.Release.Namespace}}.svc.{{.Values.clusterDomain}}:3000 + {{- if .Values.grafana.url }} + - -grafana-addr={{.Values.grafana.url}} {{- end}} {{- if .Values.jaegerUrl }} - -jaeger-addr={{.Values.jaegerUrl}} diff --git a/viz/charts/linkerd-viz/values-ha.yaml b/viz/charts/linkerd-viz/values-ha.yaml index ba278b0b3aab8..03365d2b6a8ce 100644 --- a/viz/charts/linkerd-viz/values-ha.yaml +++ b/viz/charts/linkerd-viz/values-ha.yaml @@ -22,14 +22,6 @@ tap: dashboard: resources: *ha_resources -# grafana configuration -grafana: - resources: - cpu: *ha_resources_cpu - memory: - limit: 1024Mi - request: 50Mi - # prometheus configuration prometheus: resources: @@ -38,4 +30,4 @@ prometheus: request: 300m memory: limit: 8192Mi - request: 300Mi \ No newline at end of file + request: 300Mi diff --git a/viz/charts/linkerd-viz/values.yaml b/viz/charts/linkerd-viz/values.yaml index 32e97a7378a2a..b817393b72789 100644 --- a/viz/charts/linkerd-viz/values.yaml +++ b/viz/charts/linkerd-viz/values.yaml @@ -55,9 +55,6 @@ enablePSP: false # -- url of external prometheus instance prometheusUrl: "" -# -- url of external grafana instance with reverse proxy configured. -grafanaUrl: "" - # -- url of external jaeger instance # Set this to `jaeger.linkerd-jaeger.svc.` if you plan to use jaeger extension jaegerUrl: "" @@ -347,56 +344,11 @@ dashboard: # resources: grafana: - # -- toggle field to enable or disable grafana - enabled: true - # -- log level of the grafana instance - # @default -- defaultLogLevel - logLevel: "" - # -- log format (plain, json) of the grafana instance - # @default -- defaultLogFormat - logFormat: "" - image: - # -- Docker registry for the grafana instance - # @default -- defaultRegistry - registry: "" - # -- Docker image name for the grafana instance - name: grafana - # -- Docker image tag for the grafana instance - # @default -- linkerdVersion - tag: "" - # -- Pull policy for the grafana instance - # @default -- defaultImagePullPolicy - pullPolicy: "" - - resources: - cpu: - # -- Maximum amount of CPU units that the grafana container can use - limit: - # -- Amount of CPU units that the grafana container requests - request: - memory: - # -- Maximum amount of memory that grafana container can use - limit: - # -- Amount of memory that the grafana container requests - request: - ephemeral-storage: - # -- Maximum amount of ephemeral storage that the grafana container can use - limit: "" - # -- Amount of ephemeral storage that the grafana container requests - request: "" - - proxy: - # -- If set, overrides default proxy resources for the proxy injected - # into the grafana component - # resources: - - # -- NodeSelector section, See the - # [K8S documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) for more information - nodeSelector: *default_node_selector - # -- Tolerations section, See the - # [K8S documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) - # for more information - tolerations: *default_tolerations + # -- url of a Grafana instance with reverse proxy configured, used by the + # Linkerd viz web dashboard to provide direct links to specific Grafana + # dashboards. See the [Linkerd + # documentation](https://linkerd.io/2/tasks/grafana) for more information + url: prometheus: # -- toggle field to enable or disable prometheus diff --git a/viz/cmd/install.go b/viz/cmd/install.go index 6d4d1bd6c01f3..1a8d19385adcf 100644 --- a/viz/cmd/install.go +++ b/viz/cmd/install.go @@ -25,7 +25,6 @@ var ( templatesViz = []string{ "templates/namespace.yaml", "templates/metrics-api-rbac.yaml", - "templates/grafana-rbac.yaml", "templates/prometheus-rbac.yaml", "templates/tap-rbac.yaml", "templates/web-rbac.yaml", @@ -34,8 +33,6 @@ var ( "templates/proxy-admin-policy.yaml", "templates/metrics-api.yaml", "templates/metrics-api-policy.yaml", - "templates/grafana.yaml", - "templates/grafana-policy.yaml", "templates/prometheus.yaml", "templates/tap.yaml", "templates/tap-policy.yaml", diff --git a/viz/cmd/install_test.go b/viz/cmd/install_test.go index bf3d6b289e31c..82a35d852c1f0 100644 --- a/viz/cmd/install_test.go +++ b/viz/cmd/install_test.go @@ -65,7 +65,6 @@ func TestRender(t *testing.T) { map[string]interface{}{ "prometheus": proxyResources, "tap": proxyResources, - "grafana": proxyResources, "dashboard": proxyResources, }, "install_proxy_resources.golden", @@ -83,16 +82,10 @@ func TestRender(t *testing.T) { "tag": "stable-9.2", }, }, + "grafana": map[string]interface{}{"url": "grafana.grafana:3000"}, }, "install_default_overrides.golden", }, - { - map[string]interface{}{ - "grafana": map[string]interface{}{"enabled": false}, - "grafanaUrl": "external-grafana.com", - }, - "install_grafana_disabled.golden", - }, } for i, tc := range testCases { diff --git a/viz/cmd/testdata/install_default.golden b/viz/cmd/testdata/install_default.golden index 9dda03e452a83..d4de5f160314a 100644 --- a/viz/cmd/testdata/install_default.golden +++ b/viz/cmd/testdata/install_default.golden @@ -63,19 +63,6 @@ metadata: component: metrics-api --- ### -### Grafana RBAC -### -kind: ServiceAccount -apiVersion: v1 -metadata: - name: grafana - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz ---- -### ### Prometheus RBAC ### kind: ClusterRole @@ -562,207 +549,6 @@ spec: - name: prometheus --- ### -### Grafana -### -kind: ConfigMap -apiVersion: v1 -metadata: - name: grafana-config - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -data: - grafana.ini: |- - instance_name = grafana - [server] - root_url = %(protocol)s://%(domain)s:/grafana/ - [auth] - disable_login_form = true - [auth.anonymous] - enabled = true - org_role = Editor - [auth.basic] - enabled = false - [analytics] - check_for_updates = false - [panels] - disable_sanitize_html = true - [log] - mode = console - [log.console] - format = text - level = info - datasources.yaml: |- - apiVersion: 1 - datasources: - - name: prometheus - type: prometheus - access: proxy - orgId: 1 - url: http://prometheus.linkerd-viz.svc.cluster.local:9090 - isDefault: true - jsonData: - timeInterval: "5s" - version: 1 - editable: true - - dashboards.yaml: |- - apiVersion: 1 - providers: - - name: 'default' - orgId: 1 - folder: '' - type: file - disableDeletion: true - editable: true - options: - path: /var/lib/grafana/dashboards - homeDashboardId: linkerd-top-line ---- -kind: Service -apiVersion: v1 -metadata: - name: grafana - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled -spec: - type: ClusterIP - selector: - linkerd.io/extension: viz - component: grafana - ports: - - name: http - port: 3000 - targetPort: 3000 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - config.linkerd.io/proxy-await: "enabled" - labels: - linkerd.io/extension: viz - app.kubernetes.io/name: grafana - app.kubernetes.io/part-of: Linkerd - app.kubernetes.io/version: dev-undefined - component: grafana - namespace: linkerd-viz - name: grafana - namespace: linkerd-viz -spec: - replicas: 1 - selector: - matchLabels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - template: - metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - spec: - nodeSelector: - kubernetes.io/os: linux - containers: - - env: - - name: GF_PATHS_DATA - value: /data - # Force using the go-based DNS resolver instead of the OS' to avoid failures in some environments - # see https://github.com/grafana/grafana/issues/20096 - - name: GODEBUG - value: netdns=go - image: cr.l5d.io/linkerd/grafana:dev-undefined - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /api/health - port: 3000 - initialDelaySeconds: 30 - name: grafana - ports: - - containerPort: 3000 - name: http - readinessProbe: - httpGet: - path: /api/health - port: 3000 - resources: - securityContext: - runAsUser: 472 - volumeMounts: - - mountPath: /data - name: data - - mountPath: /etc/grafana - name: grafana-config - readOnly: true - serviceAccountName: grafana - volumes: - - emptyDir: {} - name: data - - configMap: - items: - - key: grafana.ini - path: grafana.ini - - key: datasources.yaml - path: provisioning/datasources/datasources.yaml - - key: dashboards.yaml - path: provisioning/dashboards/dashboards.yaml - name: grafana-config - name: grafana-config ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: Server -metadata: - namespace: linkerd-viz - name: grafana - labels: - linkerd.io/extension: viz - component: grafana - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - podSelector: - matchLabels: - linkerd.io/extension: viz - component: grafana - port: http - proxyProtocol: HTTP/1 ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: ServerAuthorization -metadata: - namespace: linkerd-viz - name: grafana - labels: - linkerd.io/extension: viz - component: grafana - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - server: - name: grafana - client: - # web, prometheus and the kubelet probes - unauthenticated: true ---- -### ### Prometheus ### kind: ConfigMap @@ -792,17 +578,6 @@ data: static_configs: - targets: ['localhost:9090'] - - job_name: 'grafana' - kubernetes_sd_configs: - - role: pod - namespaces: - names: ['linkerd-viz'] - relabel_configs: - - source_labels: - - __meta_kubernetes_pod_container_name - action: keep - regex: ^grafana$ - # Required for: https://grafana.com/grafana/dashboards/315 - job_name: 'kubernetes-nodes-cadvisor' scheme: https @@ -1187,6 +962,8 @@ apiVersion: v1 metadata: name: tap-injector namespace: linkerd-viz + labels: + linkerd.io/extension: viz --- apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration @@ -1258,7 +1035,7 @@ spec: template: metadata: annotations: - checksum/config: 07c5bcd8a9872945d91827ee20c9412909a30ba3944731413022668c59067649 + checksum/config: 390143015ec83a86ded6630634da5834c8ac7700b93d486a7dc101a15cb87f15 linkerd.io/created-by: linkerd/helm dev-undefined linkerd.io/inject: enabled labels: @@ -1406,7 +1183,6 @@ spec: - args: - -linkerd-metrics-api-addr=metrics-api.linkerd-viz.svc.cluster.local:8085 - -cluster-domain=cluster.local - - -grafana-addr=grafana.linkerd-viz.svc.cluster.local:3000 - -controller-namespace=linkerd - -viz-namespace=linkerd-viz - -log-level=info @@ -1440,6 +1216,8 @@ kind: ServiceProfile metadata: name: metrics-api.linkerd-viz.svc.cluster.local namespace: linkerd-viz + labels: + linkerd.io/extension: viz spec: routes: - name: POST /api/v1/StatSummary @@ -1476,6 +1254,8 @@ kind: ServiceProfile metadata: name: prometheus.linkerd-viz.svc.cluster.local namespace: linkerd-viz + labels: + linkerd.io/extension: viz spec: routes: - name: POST /api/v1/query @@ -1490,55 +1270,3 @@ spec: condition: method: GET pathRegex: /api/v1/series ---- -apiVersion: linkerd.io/v1alpha2 -kind: ServiceProfile -metadata: - name: grafana.linkerd-viz.svc.cluster.local - namespace: linkerd-viz -spec: - routes: - - name: GET /api/annotations - condition: - method: GET - pathRegex: /api/annotations - - name: GET /api/dashboards/tags - condition: - method: GET - pathRegex: /api/dashboards/tags - - name: GET /api/dashboards/uid/{uid} - condition: - method: GET - pathRegex: /api/dashboards/uid/.* - - name: GET /api/dashboard/{dashboard} - condition: - method: GET - pathRegex: /api/dashboard/.* - - name: GET /api/datasources/proxy/1/api/v1/series - condition: - method: GET - pathRegex: /api/datasources/proxy/1/api/v1/series - - name: GET /api/datasources/proxy/1/api/v1/query_range - condition: - method: GET - pathRegex: /api/datasources/proxy/1/api/v1/query_range - - name: GET /api/search - condition: - method: GET - pathRegex: /api/search - - name: GET /d/{uid}/{dashboard-name} - condition: - method: GET - pathRegex: /d/[^/]*/.* - - name: GET /public/build/{style}.css - condition: - method: GET - pathRegex: /public/build/.*\.css - - name: GET /public/fonts/{font} - condition: - method: GET - pathRegex: /public/fonts/.* - - name: GET /public/img/{img} - condition: - method: GET - pathRegex: /public/img/.* diff --git a/viz/cmd/testdata/install_default_overrides.golden b/viz/cmd/testdata/install_default_overrides.golden index e695f85d9134e..8958594ad9ee2 100644 --- a/viz/cmd/testdata/install_default_overrides.golden +++ b/viz/cmd/testdata/install_default_overrides.golden @@ -63,19 +63,6 @@ metadata: component: metrics-api --- ### -### Grafana RBAC -### -kind: ServiceAccount -apiVersion: v1 -metadata: - name: grafana - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz ---- -### ### Prometheus RBAC ### kind: ClusterRole @@ -562,207 +549,6 @@ spec: - name: prometheus --- ### -### Grafana -### -kind: ConfigMap -apiVersion: v1 -metadata: - name: grafana-config - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -data: - grafana.ini: |- - instance_name = grafana - [server] - root_url = %(protocol)s://%(domain)s:/grafana/ - [auth] - disable_login_form = true - [auth.anonymous] - enabled = true - org_role = Editor - [auth.basic] - enabled = false - [analytics] - check_for_updates = false - [panels] - disable_sanitize_html = true - [log] - mode = console - [log.console] - format = text - level = debug - datasources.yaml: |- - apiVersion: 1 - datasources: - - name: prometheus - type: prometheus - access: proxy - orgId: 1 - url: http://prometheus.linkerd-viz.svc.cluster.local:9090 - isDefault: true - jsonData: - timeInterval: "5s" - version: 1 - editable: true - - dashboards.yaml: |- - apiVersion: 1 - providers: - - name: 'default' - orgId: 1 - folder: '' - type: file - disableDeletion: true - editable: true - options: - path: /var/lib/grafana/dashboards - homeDashboardId: linkerd-top-line ---- -kind: Service -apiVersion: v1 -metadata: - name: grafana - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled -spec: - type: ClusterIP - selector: - linkerd.io/extension: viz - component: grafana - ports: - - name: http - port: 3000 - targetPort: 3000 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - config.linkerd.io/proxy-await: "enabled" - labels: - linkerd.io/extension: viz - app.kubernetes.io/name: grafana - app.kubernetes.io/part-of: Linkerd - app.kubernetes.io/version: dev-undefined - component: grafana - namespace: linkerd-viz - name: grafana - namespace: linkerd-viz -spec: - replicas: 1 - selector: - matchLabels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - template: - metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - spec: - nodeSelector: - kubernetes.io/os: linux - containers: - - env: - - name: GF_PATHS_DATA - value: /data - # Force using the go-based DNS resolver instead of the OS' to avoid failures in some environments - # see https://github.com/grafana/grafana/issues/20096 - - name: GODEBUG - value: netdns=go - image: gcr.io/linkerd/grafana:dev-undefined - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /api/health - port: 3000 - initialDelaySeconds: 30 - name: grafana - ports: - - containerPort: 3000 - name: http - readinessProbe: - httpGet: - path: /api/health - port: 3000 - resources: - securityContext: - runAsUser: 472 - volumeMounts: - - mountPath: /data - name: data - - mountPath: /etc/grafana - name: grafana-config - readOnly: true - serviceAccountName: grafana - volumes: - - emptyDir: {} - name: data - - configMap: - items: - - key: grafana.ini - path: grafana.ini - - key: datasources.yaml - path: provisioning/datasources/datasources.yaml - - key: dashboards.yaml - path: provisioning/dashboards/dashboards.yaml - name: grafana-config - name: grafana-config ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: Server -metadata: - namespace: linkerd-viz - name: grafana - labels: - linkerd.io/extension: viz - component: grafana - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - podSelector: - matchLabels: - linkerd.io/extension: viz - component: grafana - port: http - proxyProtocol: HTTP/1 ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: ServerAuthorization -metadata: - namespace: linkerd-viz - name: grafana - labels: - linkerd.io/extension: viz - component: grafana - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - server: - name: grafana - client: - # web, prometheus and the kubelet probes - unauthenticated: true ---- -### ### Prometheus ### kind: ConfigMap @@ -792,17 +578,6 @@ data: static_configs: - targets: ['localhost:9090'] - - job_name: 'grafana' - kubernetes_sd_configs: - - role: pod - namespaces: - names: ['linkerd-viz'] - relabel_configs: - - source_labels: - - __meta_kubernetes_pod_container_name - action: keep - regex: ^grafana$ - # Required for: https://grafana.com/grafana/dashboards/315 - job_name: 'kubernetes-nodes-cadvisor' scheme: https @@ -1187,6 +962,8 @@ apiVersion: v1 metadata: name: tap-injector namespace: linkerd-viz + labels: + linkerd.io/extension: viz --- apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration @@ -1258,7 +1035,7 @@ spec: template: metadata: annotations: - checksum/config: 07c5bcd8a9872945d91827ee20c9412909a30ba3944731413022668c59067649 + checksum/config: 390143015ec83a86ded6630634da5834c8ac7700b93d486a7dc101a15cb87f15 linkerd.io/created-by: linkerd/helm dev-undefined linkerd.io/inject: enabled labels: @@ -1406,7 +1183,7 @@ spec: - args: - -linkerd-metrics-api-addr=metrics-api.linkerd-viz.svc.cluster.local:8085 - -cluster-domain=cluster.local - - -grafana-addr=grafana.linkerd-viz.svc.cluster.local:3000 + - -grafana-addr=grafana.grafana:3000 - -controller-namespace=linkerd - -viz-namespace=linkerd-viz - -log-level=debug @@ -1440,6 +1217,8 @@ kind: ServiceProfile metadata: name: metrics-api.linkerd-viz.svc.cluster.local namespace: linkerd-viz + labels: + linkerd.io/extension: viz spec: routes: - name: POST /api/v1/StatSummary @@ -1476,6 +1255,8 @@ kind: ServiceProfile metadata: name: prometheus.linkerd-viz.svc.cluster.local namespace: linkerd-viz + labels: + linkerd.io/extension: viz spec: routes: - name: POST /api/v1/query @@ -1490,55 +1271,3 @@ spec: condition: method: GET pathRegex: /api/v1/series ---- -apiVersion: linkerd.io/v1alpha2 -kind: ServiceProfile -metadata: - name: grafana.linkerd-viz.svc.cluster.local - namespace: linkerd-viz -spec: - routes: - - name: GET /api/annotations - condition: - method: GET - pathRegex: /api/annotations - - name: GET /api/dashboards/tags - condition: - method: GET - pathRegex: /api/dashboards/tags - - name: GET /api/dashboards/uid/{uid} - condition: - method: GET - pathRegex: /api/dashboards/uid/.* - - name: GET /api/dashboard/{dashboard} - condition: - method: GET - pathRegex: /api/dashboard/.* - - name: GET /api/datasources/proxy/1/api/v1/series - condition: - method: GET - pathRegex: /api/datasources/proxy/1/api/v1/series - - name: GET /api/datasources/proxy/1/api/v1/query_range - condition: - method: GET - pathRegex: /api/datasources/proxy/1/api/v1/query_range - - name: GET /api/search - condition: - method: GET - pathRegex: /api/search - - name: GET /d/{uid}/{dashboard-name} - condition: - method: GET - pathRegex: /d/[^/]*/.* - - name: GET /public/build/{style}.css - condition: - method: GET - pathRegex: /public/build/.*\.css - - name: GET /public/fonts/{font} - condition: - method: GET - pathRegex: /public/fonts/.* - - name: GET /public/img/{img} - condition: - method: GET - pathRegex: /public/img/.* diff --git a/viz/cmd/testdata/install_grafana_disabled.golden b/viz/cmd/testdata/install_grafana_disabled.golden deleted file mode 100644 index 2d02dc93d6668..0000000000000 --- a/viz/cmd/testdata/install_grafana_disabled.golden +++ /dev/null @@ -1,1269 +0,0 @@ ---- -### -### Linkerd Viz Extension Namespace -### -kind: Namespace -apiVersion: v1 -metadata: - name: linkerd-viz - labels: - linkerd.io/extension: viz - annotations: ---- -### -### Metrics API RBAC -### -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-linkerd-viz-metrics-api - labels: - linkerd.io/extension: viz - component: metrics-api -rules: -- apiGroups: ["extensions", "apps"] - resources: ["daemonsets", "deployments", "replicasets", "statefulsets"] - verbs: ["list", "get", "watch"] -- apiGroups: ["extensions", "batch"] - resources: ["cronjobs", "jobs"] - verbs: ["list" , "get", "watch"] -- apiGroups: [""] - resources: ["pods", "endpoints", "services", "replicationcontrollers", "namespaces"] - verbs: ["list", "get", "watch"] -- apiGroups: ["linkerd.io"] - resources: ["serviceprofiles"] - verbs: ["list", "get", "watch"] -- apiGroups: ["policy.linkerd.io"] - resources: ["servers", "serverauthorizations"] - verbs: ["list", "get"] ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-linkerd-viz-metrics-api - labels: - linkerd.io/extension: viz - component: metrics-api -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: linkerd-linkerd-viz-metrics-api -subjects: -- kind: ServiceAccount - name: metrics-api - namespace: linkerd-viz ---- -kind: ServiceAccount -apiVersion: v1 -metadata: - name: metrics-api - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: metrics-api ---- -### -### Prometheus RBAC -### -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-linkerd-viz-prometheus - labels: - linkerd.io/extension: viz - component: prometheus -rules: -- apiGroups: [""] - resources: ["nodes", "nodes/proxy", "pods"] - verbs: ["get", "list", "watch"] ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-linkerd-viz-prometheus - labels: - linkerd.io/extension: viz - component: prometheus -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: linkerd-linkerd-viz-prometheus -subjects: -- kind: ServiceAccount - name: prometheus - namespace: linkerd-viz ---- -kind: ServiceAccount -apiVersion: v1 -metadata: - name: prometheus - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: prometheus - namespace: linkerd-viz ---- -### -### Tap RBAC -### -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-linkerd-viz-tap - labels: - linkerd.io/extension: viz - component: tap -rules: -- apiGroups: [""] - resources: ["pods", "services", "replicationcontrollers", "namespaces", "nodes"] - verbs: ["list", "get", "watch"] -- apiGroups: ["extensions", "apps"] - resources: ["daemonsets", "deployments", "replicasets", "statefulsets"] - verbs: ["list", "get", "watch"] -- apiGroups: ["extensions", "batch"] - resources: ["cronjobs", "jobs"] - verbs: ["list" , "get", "watch"] ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-linkerd-viz-tap-admin - labels: - linkerd.io/extension: viz - component: tap -rules: -- apiGroups: [""] - resources: ["namespaces"] - verbs: ["list"] -- apiGroups: ["tap.linkerd.io"] - resources: ["*"] - verbs: ["watch"] ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-linkerd-viz-tap - labels: - linkerd.io/extension: viz - component: tap -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: linkerd-linkerd-viz-tap -subjects: -- kind: ServiceAccount - name: tap - namespace: linkerd-viz ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: linkerd-linkerd-viz-tap-auth-delegator - labels: - linkerd.io/extension: viz - component: tap -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: system:auth-delegator -subjects: -- kind: ServiceAccount - name: tap - namespace: linkerd-viz ---- -kind: ServiceAccount -apiVersion: v1 -metadata: - name: tap - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: tap - namespace: linkerd-viz ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: linkerd-linkerd-viz-tap-auth-reader - namespace: kube-system - labels: - linkerd.io/extension: viz - component: tap - namespace: linkerd-viz -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: extension-apiserver-authentication-reader -subjects: -- kind: ServiceAccount - name: tap - namespace: linkerd-viz ---- -apiVersion: apiregistration.k8s.io/v1 -kind: APIService -metadata: - name: v1alpha1.tap.linkerd.io - labels: - linkerd.io/extension: viz - component: tap -spec: - group: tap.linkerd.io - version: v1alpha1 - groupPriorityMinimum: 1000 - versionPriority: 100 - service: - name: tap - namespace: linkerd-viz - caBundle: dGVzdC10YXAtY2EtYnVuZGxl ---- -### -### Web RBAC -### -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: web - namespace: linkerd - labels: - linkerd.io/extension: viz - component: web - namespace: linkerd -rules: -- apiGroups: [""] - resources: ["configmaps"] - verbs: ["get"] - resourceNames: ["linkerd-config"] -- apiGroups: [""] - resources: ["namespaces", "configmaps"] - verbs: ["get"] -- apiGroups: [""] - resources: ["serviceaccounts", "pods"] - verbs: ["list"] -- apiGroups: ["apps"] - resources: ["replicasets"] - verbs: ["list"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: web - namespace: linkerd - labels: - linkerd.io/extension: viz - component: web - namespace: linkerd -roleRef: - kind: Role - name: web - apiGroup: rbac.authorization.k8s.io -subjects: -- kind: ServiceAccount - name: web - namespace: linkerd-viz ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: linkerd-linkerd-viz-web-check - labels: - linkerd.io/extension: viz - component: web -rules: -- apiGroups: ["rbac.authorization.k8s.io"] - resources: ["clusterroles", "clusterrolebindings"] - verbs: ["list"] -- apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["list"] -- apiGroups: ["admissionregistration.k8s.io"] - resources: ["mutatingwebhookconfigurations", "validatingwebhookconfigurations"] - verbs: ["list"] -- apiGroups: ["linkerd.io"] - resources: ["serviceprofiles"] - verbs: ["list"] -- apiGroups: [""] - resources: ["nodes"] - verbs: ["list"] -- apiGroups: ["apiregistration.k8s.io"] - resources: ["apiservices"] - verbs: ["get"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: linkerd-linkerd-viz-web-check - labels: - linkerd.io/extension: viz - component: web -roleRef: - kind: ClusterRole - name: linkerd-linkerd-viz-web-check - apiGroup: rbac.authorization.k8s.io -subjects: -- kind: ServiceAccount - name: web - namespace: linkerd-viz ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-linkerd-viz-web-admin - labels: - linkerd.io/extension: viz - component: web -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: linkerd-linkerd-viz-tap-admin -subjects: -- kind: ServiceAccount - name: web - namespace: linkerd-viz ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: linkerd-linkerd-viz-web-api - labels: - linkerd.io/extension: viz - component: web -rules: -- apiGroups: [""] - resources: ["namespaces"] - verbs: ["list"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: linkerd-linkerd-viz-web-api - labels: - linkerd.io/extension: viz - component: web -roleRef: - kind: ClusterRole - name: linkerd-linkerd-viz-web-api - apiGroup: rbac.authorization.k8s.io -subjects: -- kind: ServiceAccount - name: web - namespace: linkerd-viz ---- -kind: ServiceAccount -apiVersion: v1 -metadata: - name: web - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: web - namespace: linkerd-viz ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: Server -metadata: - namespace: linkerd-viz - name: admin - labels: - linkerd.io/extension: viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - podSelector: - matchLabels: - linkerd.io/extension: viz - port: admin-http - proxyProtocol: HTTP/1 ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: ServerAuthorization -metadata: - namespace: linkerd-viz - name: admin - labels: - linkerd.io/extension: viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - server: - name: admin - client: - # for kubelet probes and prometheus scraping - unauthenticated: true - ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: Server -metadata: - namespace: linkerd-viz - name: proxy-admin - labels: - linkerd.io/extension: viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - podSelector: - matchLabels: - linkerd.io/extension: viz - port: linkerd-admin - proxyProtocol: HTTP/1 ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: ServerAuthorization -metadata: - namespace: linkerd-viz - name: proxy-admin - labels: - linkerd.io/extension: viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - server: - name: proxy-admin - client: - # for kubelet probes - unauthenticated: true - ---- -### -### Metrics API -### -kind: Service -apiVersion: v1 -metadata: - name: metrics-api - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: metrics-api - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled -spec: - type: ClusterIP - selector: - linkerd.io/extension: viz - component: metrics-api - ports: - - name: http - port: 8085 - targetPort: 8085 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - config.linkerd.io/proxy-await: "enabled" - labels: - linkerd.io/extension: viz - app.kubernetes.io/name: metrics-api - app.kubernetes.io/part-of: Linkerd - app.kubernetes.io/version: dev-undefined - component: metrics-api - name: metrics-api - namespace: linkerd-viz -spec: - replicas: 1 - selector: - matchLabels: - linkerd.io/extension: viz - component: metrics-api - template: - metadata: - annotations: - checksum/config: ae930acf3edba3cbf32c43dacfa4808bf679c5c932870cb2a2a46de1023f01c8 - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - labels: - linkerd.io/extension: viz - component: metrics-api - spec: - nodeSelector: - kubernetes.io/os: linux - containers: - - args: - - -controller-namespace=linkerd - - -log-level=info - - -log-format=plain - - -cluster-domain=cluster.local - - -prometheus-url=http://prometheus.linkerd-viz.svc.cluster.local:9090 - image: cr.l5d.io/linkerd/metrics-api:dev-undefined - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /ping - port: 9995 - initialDelaySeconds: 10 - name: metrics-api - ports: - - containerPort: 8085 - name: http - - containerPort: 9995 - name: admin-http - readinessProbe: - failureThreshold: 7 - httpGet: - path: /ready - port: 9995 - resources: - securityContext: - runAsUser: 2103 - serviceAccountName: metrics-api ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: Server -metadata: - namespace: linkerd-viz - name: metrics-api - labels: - linkerd.io/extension: viz - component: metrics-api - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - podSelector: - matchLabels: - linkerd.io/extension: viz - component: metrics-api - port: http - proxyProtocol: HTTP/1 ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: ServerAuthorization -metadata: - namespace: linkerd-viz - name: metrics-api - labels: - linkerd.io/extension: viz - component: metrics-api - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - server: - name: metrics-api - client: - meshTLS: - serviceAccounts: - - name: web - - name: prometheus ---- -### -### Prometheus -### -kind: ConfigMap -apiVersion: v1 -metadata: - name: prometheus-config - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: prometheus - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -data: - prometheus.yml: |- - global: - evaluation_interval: 10s - scrape_interval: 10s - scrape_timeout: 10s - - rule_files: - - /etc/prometheus/*_rules.yml - - /etc/prometheus/*_rules.yaml - - scrape_configs: - - job_name: 'prometheus' - static_configs: - - targets: ['localhost:9090'] - - - - # Required for: https://grafana.com/grafana/dashboards/315 - - job_name: 'kubernetes-nodes-cadvisor' - scheme: https - tls_config: - ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt - insecure_skip_verify: true - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token - kubernetes_sd_configs: - - role: node - relabel_configs: - - action: labelmap - regex: __meta_kubernetes_node_label_(.+) - - target_label: __address__ - replacement: kubernetes.default.svc:443 - - source_labels: [__meta_kubernetes_node_name] - regex: (.+) - target_label: __metrics_path__ - replacement: /api/v1/nodes/$1/proxy/metrics/cadvisor - metric_relabel_configs: - - source_labels: [__name__] - regex: '(container|machine)_(cpu|memory|network|fs)_(.+)' - action: keep - - source_labels: [__name__] - regex: 'container_memory_failures_total' # unneeded large metric - action: drop - - - job_name: 'linkerd-controller' - kubernetes_sd_configs: - - role: pod - namespaces: - names: - - 'linkerd' - - 'linkerd-viz' - relabel_configs: - - source_labels: - - __meta_kubernetes_pod_container_port_name - action: keep - regex: admin-http - - source_labels: [__meta_kubernetes_pod_container_name] - action: replace - target_label: component - - - job_name: 'linkerd-service-mirror' - kubernetes_sd_configs: - - role: pod - relabel_configs: - - source_labels: - - __meta_kubernetes_pod_label_linkerd_io_control_plane_component - - __meta_kubernetes_pod_container_port_name - action: keep - regex: linkerd-service-mirror;admin-http$ - - source_labels: [__meta_kubernetes_pod_container_name] - action: replace - target_label: component - - - job_name: 'linkerd-proxy' - kubernetes_sd_configs: - - role: pod - relabel_configs: - - source_labels: - - __meta_kubernetes_pod_container_name - - __meta_kubernetes_pod_container_port_name - - __meta_kubernetes_pod_label_linkerd_io_control_plane_ns - action: keep - regex: ^linkerd-proxy;linkerd-admin;linkerd$ - - source_labels: [__meta_kubernetes_namespace] - action: replace - target_label: namespace - - source_labels: [__meta_kubernetes_pod_name] - action: replace - target_label: pod - # special case k8s' "job" label, to not interfere with prometheus' "job" - # label - # __meta_kubernetes_pod_label_linkerd_io_proxy_job=foo => - # k8s_job=foo - - source_labels: [__meta_kubernetes_pod_label_linkerd_io_proxy_job] - action: replace - target_label: k8s_job - # drop __meta_kubernetes_pod_label_linkerd_io_proxy_job - - action: labeldrop - regex: __meta_kubernetes_pod_label_linkerd_io_proxy_job - # __meta_kubernetes_pod_label_linkerd_io_proxy_deployment=foo => - # deployment=foo - - action: labelmap - regex: __meta_kubernetes_pod_label_linkerd_io_proxy_(.+) - # drop all labels that we just made copies of in the previous labelmap - - action: labeldrop - regex: __meta_kubernetes_pod_label_linkerd_io_proxy_(.+) - # __meta_kubernetes_pod_label_linkerd_io_foo=bar => - # foo=bar - - action: labelmap - regex: __meta_kubernetes_pod_label_linkerd_io_(.+) - # Copy all pod labels to tmp labels - - action: labelmap - regex: __meta_kubernetes_pod_label_(.+) - replacement: __tmp_pod_label_$1 - # Take `linkerd_io_` prefixed labels and copy them without the prefix - - action: labelmap - regex: __tmp_pod_label_linkerd_io_(.+) - replacement: __tmp_pod_label_$1 - # Drop the `linkerd_io_` originals - - action: labeldrop - regex: __tmp_pod_label_linkerd_io_(.+) - # Copy tmp labels into real labels - - action: labelmap - regex: __tmp_pod_label_(.+) ---- -kind: Service -apiVersion: v1 -metadata: - name: prometheus - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: prometheus - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled -spec: - type: ClusterIP - selector: - linkerd.io/extension: viz - component: prometheus - ports: - - name: admin-http - port: 9090 - targetPort: 9090 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - config.linkerd.io/proxy-await: "enabled" - labels: - linkerd.io/extension: viz - app.kubernetes.io/name: prometheus - app.kubernetes.io/part-of: Linkerd - app.kubernetes.io/version: dev-undefined - component: prometheus - namespace: linkerd-viz - name: prometheus - namespace: linkerd-viz -spec: - replicas: 1 - selector: - matchLabels: - linkerd.io/extension: viz - component: prometheus - namespace: linkerd-viz - template: - metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - labels: - linkerd.io/extension: viz - component: prometheus - namespace: linkerd-viz - spec: - nodeSelector: - kubernetes.io/os: linux - securityContext: - fsGroup: 65534 - containers: - - args: - - --log.level=info - - --log.format=logfmt - - --config.file=/etc/prometheus/prometheus.yml - - --storage.tsdb.path=/data - - --storage.tsdb.retention.time=6h - image: prom/prometheus:v2.30.3 - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /-/healthy - port: 9090 - initialDelaySeconds: 30 - timeoutSeconds: 30 - name: prometheus - ports: - - containerPort: 9090 - name: admin-http - readinessProbe: - httpGet: - path: /-/ready - port: 9090 - initialDelaySeconds: 30 - timeoutSeconds: 30 - resources: - securityContext: - runAsNonRoot: true - runAsUser: 65534 - runAsGroup: 65534 - volumeMounts: - - mountPath: /data - name: data - - mountPath: /etc/prometheus/prometheus.yml - name: prometheus-config - subPath: prometheus.yml - readOnly: true - serviceAccountName: prometheus - volumes: - - name: data - emptyDir: {} - - configMap: - name: prometheus-config - name: prometheus-config ---- -### -### Tap -### -kind: Service -apiVersion: v1 -metadata: - name: tap - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: tap - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled -spec: - type: ClusterIP - selector: - linkerd.io/extension: viz - component: tap - ports: - - name: grpc - port: 8088 - targetPort: 8088 - - name: apiserver - port: 443 - targetPort: apiserver ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - config.linkerd.io/proxy-await: "enabled" - labels: - linkerd.io/extension: viz - app.kubernetes.io/name: tap - app.kubernetes.io/part-of: Linkerd - app.kubernetes.io/version: dev-undefined - component: tap - namespace: linkerd-viz - name: tap - namespace: linkerd-viz -spec: - replicas: 1 - selector: - matchLabels: - linkerd.io/extension: viz - component: tap - namespace: linkerd-viz - template: - metadata: - annotations: - checksum/config: d6f2ea38c4004667c96eb4fb0135fe0d9d9a87f5c19aaee30e6ccb6ef7219324 - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - labels: - linkerd.io/extension: viz - component: tap - namespace: linkerd-viz - spec: - nodeSelector: - kubernetes.io/os: linux - containers: - - args: - - api - - -api-namespace=linkerd - - -log-level=info - - -log-format=plain - - -identity-trust-domain=cluster.local - image: cr.l5d.io/linkerd/tap:dev-undefined - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /ping - port: 9998 - initialDelaySeconds: 10 - name: tap - ports: - - containerPort: 8088 - name: grpc - - containerPort: 8089 - name: apiserver - - containerPort: 9998 - name: admin-http - readinessProbe: - failureThreshold: 7 - httpGet: - path: /ready - port: 9998 - resources: - securityContext: - runAsUser: 2103 - volumeMounts: - - mountPath: /var/run/linkerd/tls - name: tls - readOnly: true - serviceAccountName: tap - volumes: - - name: tls - secret: - secretName: tap-k8s-tls ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: Server -metadata: - namespace: linkerd-viz - name: tap-api - labels: - linkerd.io/extension: viz - component: tap - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - podSelector: - matchLabels: - linkerd.io/extension: viz - component: tap - port: apiserver - proxyProtocol: TLS ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: ServerAuthorization -metadata: - namespace: linkerd-viz - name: tap - labels: - linkerd.io/extension: viz - component: tap - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - server: - name: tap-api - client: - # traffic coming from kube-api - unauthenticated: true ---- -### -### Tap Injector RBAC -### -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-tap-injector - labels: - linkerd.io/extension: viz -rules: -- apiGroups: [""] - resources: ["namespaces"] - verbs: ["get", "list", "watch"] ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: linkerd-tap-injector - labels: - linkerd.io/extension: viz -subjects: -- kind: ServiceAccount - name: tap-injector - namespace: linkerd-viz -roleRef: - kind: ClusterRole - name: linkerd-tap-injector - apiGroup: rbac.authorization.k8s.io ---- -kind: ServiceAccount -apiVersion: v1 -metadata: - name: tap-injector - namespace: linkerd-viz ---- -apiVersion: admissionregistration.k8s.io/v1 -kind: MutatingWebhookConfiguration -metadata: - name: linkerd-tap-injector-webhook-config - labels: - linkerd.io/extension: viz -webhooks: -- name: tap-injector.linkerd.io - clientConfig: - service: - name: tap-injector - namespace: linkerd-viz - path: "/" - caBundle: dGVzdC10YXAtY2EtYnVuZGxl - failurePolicy: Ignore - admissionReviewVersions: ["v1", "v1beta1"] - reinvocationPolicy: IfNeeded - rules: - - operations: [ "CREATE" ] - apiGroups: [""] - apiVersions: ["v1"] - resources: ["pods"] - sideEffects: None ---- -### -### Tap Injector -### -kind: Service -apiVersion: v1 -metadata: - name: tap-injector - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: tap-injector - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled -spec: - type: ClusterIP - selector: - linkerd.io/extension: viz - component: tap-injector - ports: - - name: tap-injector - port: 443 - targetPort: tap-injector ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - config.linkerd.io/proxy-await: "enabled" - labels: - linkerd.io/extension: viz - app.kubernetes.io/name: tap-injector - app.kubernetes.io/part-of: Linkerd - component: tap-injector - name: tap-injector - namespace: linkerd-viz -spec: - replicas: 1 - selector: - matchLabels: - component: tap-injector - template: - metadata: - annotations: - checksum/config: 07c5bcd8a9872945d91827ee20c9412909a30ba3944731413022668c59067649 - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - labels: - linkerd.io/extension: viz - component: tap-injector - spec: - nodeSelector: - kubernetes.io/os: linux - containers: - - args: - - injector - - -tap-service-name=tap.linkerd-viz.serviceaccount.identity.linkerd.cluster.local - - -log-level=info - - -log-format=plain - image: cr.l5d.io/linkerd/tap:dev-undefined - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /ping - port: 9995 - initialDelaySeconds: 10 - name: tap-injector - ports: - - containerPort: 8443 - name: tap-injector - - containerPort: 9995 - name: admin-http - readinessProbe: - failureThreshold: 7 - httpGet: - path: /ready - port: 9995 - resources: - securityContext: - runAsUser: 2103 - volumeMounts: - - mountPath: /var/run/linkerd/tls - name: tls - readOnly: true - serviceAccountName: tap-injector - volumes: - - name: tls - secret: - secretName: tap-injector-k8s-tls ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: Server -metadata: - namespace: linkerd-viz - name: tap-injector-webhook - labels: - linkerd.io/extension: viz - component: tap-injector - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - podSelector: - matchLabels: - linkerd.io/extension: viz - component: tap-injector - port: tap-injector - proxyProtocol: TLS ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: ServerAuthorization -metadata: - namespace: linkerd-viz - name: tap-injector - labels: - linkerd.io/extension: viz - component: tap-injector - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - server: - name: tap-injector-webhook - client: - # traffic coming from kube-api - unauthenticated: true ---- -### -### Web -### -kind: Service -apiVersion: v1 -metadata: - name: web - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: web - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled -spec: - type: ClusterIP - selector: - linkerd.io/extension: viz - component: web - ports: - - name: http - port: 8084 - targetPort: 8084 - - name: admin-http - port: 9994 - targetPort: 9994 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - config.linkerd.io/proxy-await: "enabled" - labels: - linkerd.io/extension: viz - app.kubernetes.io/name: web - app.kubernetes.io/part-of: Linkerd - app.kubernetes.io/version: dev-undefined - component: web - namespace: linkerd-viz - name: web - namespace: linkerd-viz -spec: - replicas: 1 - selector: - matchLabels: - linkerd.io/extension: viz - component: web - namespace: linkerd-viz - template: - metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - labels: - linkerd.io/extension: viz - component: web - namespace: linkerd-viz - spec: - nodeSelector: - kubernetes.io/os: linux - containers: - - args: - - -linkerd-metrics-api-addr=metrics-api.linkerd-viz.svc.cluster.local:8085 - - -cluster-domain=cluster.local - - -grafana-addr=external-grafana.com - - -controller-namespace=linkerd - - -viz-namespace=linkerd-viz - - -log-level=info - - -log-format=plain - - -enforced-host=^(localhost|127\.0\.0\.1|web\.linkerd-viz\.svc\.cluster\.local|web\.linkerd-viz\.svc|\[::1\])(:\d+)?$ - image: cr.l5d.io/linkerd/web:dev-undefined - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /ping - port: 9994 - initialDelaySeconds: 10 - name: web - ports: - - containerPort: 8084 - name: http - - containerPort: 9994 - name: admin-http - readinessProbe: - failureThreshold: 7 - httpGet: - path: /ready - port: 9994 - resources: - securityContext: - runAsUser: 2103 - serviceAccountName: web ---- -apiVersion: linkerd.io/v1alpha2 -kind: ServiceProfile -metadata: - name: metrics-api.linkerd-viz.svc.cluster.local - namespace: linkerd-viz -spec: - routes: - - name: POST /api/v1/StatSummary - condition: - method: POST - pathRegex: /api/v1/StatSummary - - name: POST /api/v1/TopRoutes - condition: - method: POST - pathRegex: /api/v1/TopRoutes - - name: POST /api/v1/ListPods - condition: - method: POST - pathRegex: /api/v1/ListPods - - name: POST /api/v1/ListServices - condition: - method: POST - pathRegex: /api/v1/ListServices - - name: POST /api/v1/SelfCheck - condition: - method: POST - pathRegex: /api/v1/SelfCheck - - name: POST /api/v1/Gateways - condition: - method: POST - pathRegex: /api/v1/Gateways - - name: POST /api/v1/Edges - condition: - method: POST - pathRegex: /api/v1/Edges ---- -apiVersion: linkerd.io/v1alpha2 -kind: ServiceProfile -metadata: - name: prometheus.linkerd-viz.svc.cluster.local - namespace: linkerd-viz -spec: - routes: - - name: POST /api/v1/query - condition: - method: POST - pathRegex: /api/v1/query - - name: GET /api/v1/query_range - condition: - method: GET - pathRegex: /api/v1/query_range - - name: GET /api/v1/series - condition: - method: GET - pathRegex: /api/v1/series diff --git a/viz/cmd/testdata/install_prometheus_disabled.golden b/viz/cmd/testdata/install_prometheus_disabled.golden index 957dc6a99be81..5c35bd87d0675 100644 --- a/viz/cmd/testdata/install_prometheus_disabled.golden +++ b/viz/cmd/testdata/install_prometheus_disabled.golden @@ -64,19 +64,6 @@ metadata: component: metrics-api --- ### -### Grafana RBAC -### -kind: ServiceAccount -apiVersion: v1 -metadata: - name: grafana - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz ---- -### ### Tap RBAC ### kind: ClusterRole @@ -522,207 +509,6 @@ spec: - name: prometheus --- ### -### Grafana -### -kind: ConfigMap -apiVersion: v1 -metadata: - name: grafana-config - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -data: - grafana.ini: |- - instance_name = grafana - [server] - root_url = %(protocol)s://%(domain)s:/grafana/ - [auth] - disable_login_form = true - [auth.anonymous] - enabled = true - org_role = Editor - [auth.basic] - enabled = false - [analytics] - check_for_updates = false - [panels] - disable_sanitize_html = true - [log] - mode = console - [log.console] - format = text - level = info - datasources.yaml: |- - apiVersion: 1 - datasources: - - name: prometheus - type: prometheus - access: proxy - orgId: 1 - url: external-prom.com - isDefault: true - jsonData: - timeInterval: "5s" - version: 1 - editable: true - - dashboards.yaml: |- - apiVersion: 1 - providers: - - name: 'default' - orgId: 1 - folder: '' - type: file - disableDeletion: true - editable: true - options: - path: /var/lib/grafana/dashboards - homeDashboardId: linkerd-top-line ---- -kind: Service -apiVersion: v1 -metadata: - name: grafana - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled -spec: - type: ClusterIP - selector: - linkerd.io/extension: viz - component: grafana - ports: - - name: http - port: 3000 - targetPort: 3000 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - config.linkerd.io/proxy-await: "enabled" - labels: - linkerd.io/extension: viz - app.kubernetes.io/name: grafana - app.kubernetes.io/part-of: Linkerd - app.kubernetes.io/version: dev-undefined - component: grafana - namespace: linkerd-viz - name: grafana - namespace: linkerd-viz -spec: - replicas: 1 - selector: - matchLabels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - template: - metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - spec: - nodeSelector: - kubernetes.io/os: linux - containers: - - env: - - name: GF_PATHS_DATA - value: /data - # Force using the go-based DNS resolver instead of the OS' to avoid failures in some environments - # see https://github.com/grafana/grafana/issues/20096 - - name: GODEBUG - value: netdns=go - image: cr.l5d.io/linkerd/grafana:dev-undefined - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /api/health - port: 3000 - initialDelaySeconds: 30 - name: grafana - ports: - - containerPort: 3000 - name: http - readinessProbe: - httpGet: - path: /api/health - port: 3000 - resources: - securityContext: - runAsUser: 472 - volumeMounts: - - mountPath: /data - name: data - - mountPath: /etc/grafana - name: grafana-config - readOnly: true - serviceAccountName: grafana - volumes: - - emptyDir: {} - name: data - - configMap: - items: - - key: grafana.ini - path: grafana.ini - - key: datasources.yaml - path: provisioning/datasources/datasources.yaml - - key: dashboards.yaml - path: provisioning/dashboards/dashboards.yaml - name: grafana-config - name: grafana-config ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: Server -metadata: - namespace: linkerd-viz - name: grafana - labels: - linkerd.io/extension: viz - component: grafana - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - podSelector: - matchLabels: - linkerd.io/extension: viz - component: grafana - port: http - proxyProtocol: HTTP/1 ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: ServerAuthorization -metadata: - namespace: linkerd-viz - name: grafana - labels: - linkerd.io/extension: viz - component: grafana - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - server: - name: grafana - client: - # web, prometheus and the kubelet probes - unauthenticated: true ---- -### ### Tap ### kind: Service @@ -895,6 +681,8 @@ apiVersion: v1 metadata: name: tap-injector namespace: linkerd-viz + labels: + linkerd.io/extension: viz --- apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration @@ -966,7 +754,7 @@ spec: template: metadata: annotations: - checksum/config: 07c5bcd8a9872945d91827ee20c9412909a30ba3944731413022668c59067649 + checksum/config: 390143015ec83a86ded6630634da5834c8ac7700b93d486a7dc101a15cb87f15 linkerd.io/created-by: linkerd/helm dev-undefined linkerd.io/inject: enabled labels: @@ -1114,7 +902,6 @@ spec: - args: - -linkerd-metrics-api-addr=metrics-api.linkerd-viz.svc.cluster.local:8085 - -cluster-domain=cluster.local - - -grafana-addr=grafana.linkerd-viz.svc.cluster.local:3000 - -controller-namespace=linkerd - -viz-namespace=linkerd-viz - -log-level=info @@ -1148,6 +935,8 @@ kind: ServiceProfile metadata: name: metrics-api.linkerd-viz.svc.cluster.local namespace: linkerd-viz + labels: + linkerd.io/extension: viz spec: routes: - name: POST /api/v1/StatSummary @@ -1178,55 +967,3 @@ spec: condition: method: POST pathRegex: /api/v1/Edges ---- -apiVersion: linkerd.io/v1alpha2 -kind: ServiceProfile -metadata: - name: grafana.linkerd-viz.svc.cluster.local - namespace: linkerd-viz -spec: - routes: - - name: GET /api/annotations - condition: - method: GET - pathRegex: /api/annotations - - name: GET /api/dashboards/tags - condition: - method: GET - pathRegex: /api/dashboards/tags - - name: GET /api/dashboards/uid/{uid} - condition: - method: GET - pathRegex: /api/dashboards/uid/.* - - name: GET /api/dashboard/{dashboard} - condition: - method: GET - pathRegex: /api/dashboard/.* - - name: GET /api/datasources/proxy/1/api/v1/series - condition: - method: GET - pathRegex: /api/datasources/proxy/1/api/v1/series - - name: GET /api/datasources/proxy/1/api/v1/query_range - condition: - method: GET - pathRegex: /api/datasources/proxy/1/api/v1/query_range - - name: GET /api/search - condition: - method: GET - pathRegex: /api/search - - name: GET /d/{uid}/{dashboard-name} - condition: - method: GET - pathRegex: /d/[^/]*/.* - - name: GET /public/build/{style}.css - condition: - method: GET - pathRegex: /public/build/.*\.css - - name: GET /public/fonts/{font} - condition: - method: GET - pathRegex: /public/fonts/.* - - name: GET /public/img/{img} - condition: - method: GET - pathRegex: /public/img/.* diff --git a/viz/cmd/testdata/install_prometheus_loglevel_from_args.golden b/viz/cmd/testdata/install_prometheus_loglevel_from_args.golden index 8de0f22574020..d74133b889bd2 100644 --- a/viz/cmd/testdata/install_prometheus_loglevel_from_args.golden +++ b/viz/cmd/testdata/install_prometheus_loglevel_from_args.golden @@ -63,19 +63,6 @@ metadata: component: metrics-api --- ### -### Grafana RBAC -### -kind: ServiceAccount -apiVersion: v1 -metadata: - name: grafana - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz ---- -### ### Prometheus RBAC ### kind: ClusterRole @@ -562,207 +549,6 @@ spec: - name: prometheus --- ### -### Grafana -### -kind: ConfigMap -apiVersion: v1 -metadata: - name: grafana-config - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -data: - grafana.ini: |- - instance_name = grafana - [server] - root_url = %(protocol)s://%(domain)s:/grafana/ - [auth] - disable_login_form = true - [auth.anonymous] - enabled = true - org_role = Editor - [auth.basic] - enabled = false - [analytics] - check_for_updates = false - [panels] - disable_sanitize_html = true - [log] - mode = console - [log.console] - format = text - level = info - datasources.yaml: |- - apiVersion: 1 - datasources: - - name: prometheus - type: prometheus - access: proxy - orgId: 1 - url: http://prometheus.linkerd-viz.svc.cluster.local:9090 - isDefault: true - jsonData: - timeInterval: "5s" - version: 1 - editable: true - - dashboards.yaml: |- - apiVersion: 1 - providers: - - name: 'default' - orgId: 1 - folder: '' - type: file - disableDeletion: true - editable: true - options: - path: /var/lib/grafana/dashboards - homeDashboardId: linkerd-top-line ---- -kind: Service -apiVersion: v1 -metadata: - name: grafana - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled -spec: - type: ClusterIP - selector: - linkerd.io/extension: viz - component: grafana - ports: - - name: http - port: 3000 - targetPort: 3000 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - config.linkerd.io/proxy-await: "enabled" - labels: - linkerd.io/extension: viz - app.kubernetes.io/name: grafana - app.kubernetes.io/part-of: Linkerd - app.kubernetes.io/version: dev-undefined - component: grafana - namespace: linkerd-viz - name: grafana - namespace: linkerd-viz -spec: - replicas: 1 - selector: - matchLabels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - template: - metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - spec: - nodeSelector: - kubernetes.io/os: linux - containers: - - env: - - name: GF_PATHS_DATA - value: /data - # Force using the go-based DNS resolver instead of the OS' to avoid failures in some environments - # see https://github.com/grafana/grafana/issues/20096 - - name: GODEBUG - value: netdns=go - image: cr.l5d.io/linkerd/grafana:dev-undefined - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /api/health - port: 3000 - initialDelaySeconds: 30 - name: grafana - ports: - - containerPort: 3000 - name: http - readinessProbe: - httpGet: - path: /api/health - port: 3000 - resources: - securityContext: - runAsUser: 472 - volumeMounts: - - mountPath: /data - name: data - - mountPath: /etc/grafana - name: grafana-config - readOnly: true - serviceAccountName: grafana - volumes: - - emptyDir: {} - name: data - - configMap: - items: - - key: grafana.ini - path: grafana.ini - - key: datasources.yaml - path: provisioning/datasources/datasources.yaml - - key: dashboards.yaml - path: provisioning/dashboards/dashboards.yaml - name: grafana-config - name: grafana-config ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: Server -metadata: - namespace: linkerd-viz - name: grafana - labels: - linkerd.io/extension: viz - component: grafana - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - podSelector: - matchLabels: - linkerd.io/extension: viz - component: grafana - port: http - proxyProtocol: HTTP/1 ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: ServerAuthorization -metadata: - namespace: linkerd-viz - name: grafana - labels: - linkerd.io/extension: viz - component: grafana - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - server: - name: grafana - client: - # web, prometheus and the kubelet probes - unauthenticated: true ---- -### ### Prometheus ### kind: ConfigMap @@ -792,17 +578,6 @@ data: static_configs: - targets: ['localhost:9090'] - - job_name: 'grafana' - kubernetes_sd_configs: - - role: pod - namespaces: - names: ['linkerd-viz'] - relabel_configs: - - source_labels: - - __meta_kubernetes_pod_container_name - action: keep - regex: ^grafana$ - # Required for: https://grafana.com/grafana/dashboards/315 - job_name: 'kubernetes-nodes-cadvisor' scheme: https @@ -1187,6 +962,8 @@ apiVersion: v1 metadata: name: tap-injector namespace: linkerd-viz + labels: + linkerd.io/extension: viz --- apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration @@ -1258,7 +1035,7 @@ spec: template: metadata: annotations: - checksum/config: 07c5bcd8a9872945d91827ee20c9412909a30ba3944731413022668c59067649 + checksum/config: 390143015ec83a86ded6630634da5834c8ac7700b93d486a7dc101a15cb87f15 linkerd.io/created-by: linkerd/helm dev-undefined linkerd.io/inject: enabled labels: @@ -1406,7 +1183,6 @@ spec: - args: - -linkerd-metrics-api-addr=metrics-api.linkerd-viz.svc.cluster.local:8085 - -cluster-domain=cluster.local - - -grafana-addr=grafana.linkerd-viz.svc.cluster.local:3000 - -controller-namespace=linkerd - -viz-namespace=linkerd-viz - -log-level=info @@ -1440,6 +1216,8 @@ kind: ServiceProfile metadata: name: metrics-api.linkerd-viz.svc.cluster.local namespace: linkerd-viz + labels: + linkerd.io/extension: viz spec: routes: - name: POST /api/v1/StatSummary @@ -1476,6 +1254,8 @@ kind: ServiceProfile metadata: name: prometheus.linkerd-viz.svc.cluster.local namespace: linkerd-viz + labels: + linkerd.io/extension: viz spec: routes: - name: POST /api/v1/query @@ -1490,55 +1270,3 @@ spec: condition: method: GET pathRegex: /api/v1/series ---- -apiVersion: linkerd.io/v1alpha2 -kind: ServiceProfile -metadata: - name: grafana.linkerd-viz.svc.cluster.local - namespace: linkerd-viz -spec: - routes: - - name: GET /api/annotations - condition: - method: GET - pathRegex: /api/annotations - - name: GET /api/dashboards/tags - condition: - method: GET - pathRegex: /api/dashboards/tags - - name: GET /api/dashboards/uid/{uid} - condition: - method: GET - pathRegex: /api/dashboards/uid/.* - - name: GET /api/dashboard/{dashboard} - condition: - method: GET - pathRegex: /api/dashboard/.* - - name: GET /api/datasources/proxy/1/api/v1/series - condition: - method: GET - pathRegex: /api/datasources/proxy/1/api/v1/series - - name: GET /api/datasources/proxy/1/api/v1/query_range - condition: - method: GET - pathRegex: /api/datasources/proxy/1/api/v1/query_range - - name: GET /api/search - condition: - method: GET - pathRegex: /api/search - - name: GET /d/{uid}/{dashboard-name} - condition: - method: GET - pathRegex: /d/[^/]*/.* - - name: GET /public/build/{style}.css - condition: - method: GET - pathRegex: /public/build/.*\.css - - name: GET /public/fonts/{font} - condition: - method: GET - pathRegex: /public/fonts/.* - - name: GET /public/img/{img} - condition: - method: GET - pathRegex: /public/img/.* diff --git a/viz/cmd/testdata/install_proxy_resources.golden b/viz/cmd/testdata/install_proxy_resources.golden index 4204a57e4de13..98f839f27b638 100644 --- a/viz/cmd/testdata/install_proxy_resources.golden +++ b/viz/cmd/testdata/install_proxy_resources.golden @@ -63,19 +63,6 @@ metadata: component: metrics-api --- ### -### Grafana RBAC -### -kind: ServiceAccount -apiVersion: v1 -metadata: - name: grafana - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz ---- -### ### Prometheus RBAC ### kind: ClusterRole @@ -562,211 +549,6 @@ spec: - name: prometheus --- ### -### Grafana -### -kind: ConfigMap -apiVersion: v1 -metadata: - name: grafana-config - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -data: - grafana.ini: |- - instance_name = grafana - [server] - root_url = %(protocol)s://%(domain)s:/grafana/ - [auth] - disable_login_form = true - [auth.anonymous] - enabled = true - org_role = Editor - [auth.basic] - enabled = false - [analytics] - check_for_updates = false - [panels] - disable_sanitize_html = true - [log] - mode = console - [log.console] - format = text - level = info - datasources.yaml: |- - apiVersion: 1 - datasources: - - name: prometheus - type: prometheus - access: proxy - orgId: 1 - url: http://prometheus.linkerd-viz.svc.cluster.local:9090 - isDefault: true - jsonData: - timeInterval: "5s" - version: 1 - editable: true - - dashboards.yaml: |- - apiVersion: 1 - providers: - - name: 'default' - orgId: 1 - folder: '' - type: file - disableDeletion: true - editable: true - options: - path: /var/lib/grafana/dashboards - homeDashboardId: linkerd-top-line ---- -kind: Service -apiVersion: v1 -metadata: - name: grafana - namespace: linkerd-viz - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled -spec: - type: ClusterIP - selector: - linkerd.io/extension: viz - component: grafana - ports: - - name: http - port: 3000 - targetPort: 3000 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - linkerd.io/inject: enabled - config.linkerd.io/proxy-await: "enabled" - labels: - linkerd.io/extension: viz - app.kubernetes.io/name: grafana - app.kubernetes.io/part-of: Linkerd - app.kubernetes.io/version: dev-undefined - component: grafana - namespace: linkerd-viz - name: grafana - namespace: linkerd-viz -spec: - replicas: 1 - selector: - matchLabels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - template: - metadata: - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined - config.linkerd.io/proxy-cpu-request: "500m" - config.linkerd.io/proxy-cpu-limit: "100m" - config.linkerd.io/proxy-memory-request: "20Mi" - config.linkerd.io/proxy-memory-limit: "250Mi" - linkerd.io/inject: enabled - labels: - linkerd.io/extension: viz - component: grafana - namespace: linkerd-viz - spec: - nodeSelector: - kubernetes.io/os: linux - containers: - - env: - - name: GF_PATHS_DATA - value: /data - # Force using the go-based DNS resolver instead of the OS' to avoid failures in some environments - # see https://github.com/grafana/grafana/issues/20096 - - name: GODEBUG - value: netdns=go - image: cr.l5d.io/linkerd/grafana:dev-undefined - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /api/health - port: 3000 - initialDelaySeconds: 30 - name: grafana - ports: - - containerPort: 3000 - name: http - readinessProbe: - httpGet: - path: /api/health - port: 3000 - resources: - securityContext: - runAsUser: 472 - volumeMounts: - - mountPath: /data - name: data - - mountPath: /etc/grafana - name: grafana-config - readOnly: true - serviceAccountName: grafana - volumes: - - emptyDir: {} - name: data - - configMap: - items: - - key: grafana.ini - path: grafana.ini - - key: datasources.yaml - path: provisioning/datasources/datasources.yaml - - key: dashboards.yaml - path: provisioning/dashboards/dashboards.yaml - name: grafana-config - name: grafana-config ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: Server -metadata: - namespace: linkerd-viz - name: grafana - labels: - linkerd.io/extension: viz - component: grafana - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - podSelector: - matchLabels: - linkerd.io/extension: viz - component: grafana - port: http - proxyProtocol: HTTP/1 ---- -apiVersion: policy.linkerd.io/v1beta1 -kind: ServerAuthorization -metadata: - namespace: linkerd-viz - name: grafana - labels: - linkerd.io/extension: viz - component: grafana - annotations: - linkerd.io/created-by: linkerd/helm dev-undefined -spec: - server: - name: grafana - client: - # web, prometheus and the kubelet probes - unauthenticated: true ---- -### ### Prometheus ### kind: ConfigMap @@ -796,17 +578,6 @@ data: static_configs: - targets: ['localhost:9090'] - - job_name: 'grafana' - kubernetes_sd_configs: - - role: pod - namespaces: - names: ['linkerd-viz'] - relabel_configs: - - source_labels: - - __meta_kubernetes_pod_container_name - action: keep - regex: ^grafana$ - # Required for: https://grafana.com/grafana/dashboards/315 - job_name: 'kubernetes-nodes-cadvisor' scheme: https @@ -1199,6 +970,8 @@ apiVersion: v1 metadata: name: tap-injector namespace: linkerd-viz + labels: + linkerd.io/extension: viz --- apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration @@ -1270,7 +1043,7 @@ spec: template: metadata: annotations: - checksum/config: 07c5bcd8a9872945d91827ee20c9412909a30ba3944731413022668c59067649 + checksum/config: 390143015ec83a86ded6630634da5834c8ac7700b93d486a7dc101a15cb87f15 linkerd.io/created-by: linkerd/helm dev-undefined linkerd.io/inject: enabled labels: @@ -1422,7 +1195,6 @@ spec: - args: - -linkerd-metrics-api-addr=metrics-api.linkerd-viz.svc.cluster.local:8085 - -cluster-domain=cluster.local - - -grafana-addr=grafana.linkerd-viz.svc.cluster.local:3000 - -controller-namespace=linkerd - -viz-namespace=linkerd-viz - -log-level=info @@ -1456,6 +1228,8 @@ kind: ServiceProfile metadata: name: metrics-api.linkerd-viz.svc.cluster.local namespace: linkerd-viz + labels: + linkerd.io/extension: viz spec: routes: - name: POST /api/v1/StatSummary @@ -1492,6 +1266,8 @@ kind: ServiceProfile metadata: name: prometheus.linkerd-viz.svc.cluster.local namespace: linkerd-viz + labels: + linkerd.io/extension: viz spec: routes: - name: POST /api/v1/query @@ -1506,55 +1282,3 @@ spec: condition: method: GET pathRegex: /api/v1/series ---- -apiVersion: linkerd.io/v1alpha2 -kind: ServiceProfile -metadata: - name: grafana.linkerd-viz.svc.cluster.local - namespace: linkerd-viz -spec: - routes: - - name: GET /api/annotations - condition: - method: GET - pathRegex: /api/annotations - - name: GET /api/dashboards/tags - condition: - method: GET - pathRegex: /api/dashboards/tags - - name: GET /api/dashboards/uid/{uid} - condition: - method: GET - pathRegex: /api/dashboards/uid/.* - - name: GET /api/dashboard/{dashboard} - condition: - method: GET - pathRegex: /api/dashboard/.* - - name: GET /api/datasources/proxy/1/api/v1/series - condition: - method: GET - pathRegex: /api/datasources/proxy/1/api/v1/series - - name: GET /api/datasources/proxy/1/api/v1/query_range - condition: - method: GET - pathRegex: /api/datasources/proxy/1/api/v1/query_range - - name: GET /api/search - condition: - method: GET - pathRegex: /api/search - - name: GET /d/{uid}/{dashboard-name} - condition: - method: GET - pathRegex: /d/[^/]*/.* - - name: GET /public/build/{style}.css - condition: - method: GET - pathRegex: /public/build/.*\.css - - name: GET /public/fonts/{font} - condition: - method: GET - pathRegex: /public/fonts/.* - - name: GET /public/img/{img} - condition: - method: GET - pathRegex: /public/img/.*