Skip to content

Commit

Permalink
Stop shipping grafana-based image (#7567)
Browse files Browse the repository at this point in the history
* Stop shipping grafana-based image

Fixes #6045 #7358

With this change we stop building a Grafana-based image preloaded with the Linkerd Grafana dashboards.

Instead, we'll recommend users to install Grafana by themselves, and we provide a file `grafana/values.yaml` with a default config that points to all the same Grafana dashboards we had, which are now hosted in https://grafana.com/orgs/linkerd/dashboards .

The new file `grafana/README.md` contains instructions for installing the official Grafana Helm chart, and mentions other available methods.

The `grafana.enabled` flag has been removed, and `grafanaUrl` has been moved to `grafana.url`. This will help consolidating other grafana settings that might emerge, in particular when #7429 gets addressed.

## Dashboards definitions changes

The dashboard definitions under `grafana/dashboards` (which should be kept in sync with what's published in https://grafana.com/orgs/linkerd/dashboards), got updated, adding the `__inputs`, `__elements` and `__requires` entries at the beginning, that were required in order to be published.
  • Loading branch information
alpeb authored Jan 11, 2022
1 parent dbb2fd2 commit 67dfebb
Show file tree
Hide file tree
Showing 73 changed files with 1,074 additions and 4,211 deletions.
1 change: 0 additions & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
- cni-plugin
- controller
- debug
- grafana
- jaeger-webhook
- metrics-api
- policy-controller
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
- cni-plugin
- controller
- debug
- grafana
- jaeger-webhook
- metrics-api
- proxy
Expand Down
2 changes: 0 additions & 2 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion bin/_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export DOCKER_IMAGES=(${DOCKER_IMAGES:-
policy-controller
metrics-api
debug
grafana
proxy
web
jaeger-webhook
Expand Down
2 changes: 1 addition & 1 deletion bin/_test-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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##*/}"
Expand Down
1 change: 0 additions & 1 deletion bin/docker-build
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 0 additions & 20 deletions bin/docker-build-grafana

This file was deleted.

7 changes: 0 additions & 7 deletions bin/web
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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 && \
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/cmd/testdata/install_custom_domain.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/cmd/testdata/install_custom_registry.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/cmd/testdata/install_default.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/cmd/testdata/install_default_token.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/cmd/testdata/install_ha_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/cmd/testdata/install_ha_with_overrides_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/cmd/testdata/install_heartbeat_disabled_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/cmd/testdata/install_helm_control_plane_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/cmd/testdata/install_helm_output_ha_labels.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/cmd/testdata/install_no_init_container.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/cmd/testdata/install_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/cmd/testdata/install_proxy_ignores.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cli/cmd/testdata/install_values_file.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions grafana/Dockerfile

This file was deleted.

43 changes: 43 additions & 0 deletions grafana/README.md
Original file line number Diff line number Diff line change
@@ -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
<https://grafana.com/orgs/linkerd/dashboards>.

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 <https://grafana.com/orgs/linkerd>. 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.
47 changes: 47 additions & 0 deletions grafana/dashboards/authority.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down
47 changes: 47 additions & 0 deletions grafana/dashboards/cronjob.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down
Loading

0 comments on commit 67dfebb

Please sign in to comment.