Skip to content

Commit

Permalink
Docs for Grafana removal
Browse files Browse the repository at this point in the history
Followup to linkerd/linkerd2#7567

This is branched off of `alpeb/2.12`.

- Upgraded 2.12 upgrade notes, to explain linkerd viz no longer installs
  a grafana instance
- Created tasks/grafana.md explaining how to install and configure
  grafana and hookup the linkerd grafana dashboards
  • Loading branch information
alpeb committed Jan 10, 2022
1 parent 5e56efc commit 6fd673e
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 56 deletions.
4 changes: 2 additions & 2 deletions linkerd.io/content/2.12/features/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ This extension installs the following components into your `linkerd-viz`
namespace:

* A [Prometheus](https://prometheus.io/) instance
* A [Grafana](https://grafana.com/) instance
* metrics-api, tap, tap-injector, and web components

These components work together to provide an on-cluster metrics stack.
Expand Down Expand Up @@ -71,7 +70,8 @@ The dashboards that are provided out of the box include:

{{< /gallery >}}

linkerd -n emojivoto check --proxy
See our [Grafana docs](../../tasks/grafana) for instructions on how to install
Grafana and load these dashboards.

## Examples

Expand Down
2 changes: 1 addition & 1 deletion linkerd.io/content/2.12/features/ha.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ violated (e.g. the cluster is scaled down to two or fewer nodes), then the
system may be left in a non-functional state.

Note that these anti-affinity rules don't apply to add-on components like
Prometheus and Grafana.
Prometheus.

## Scaling Prometheus

Expand Down
2 changes: 1 addition & 1 deletion linkerd.io/content/2.12/features/telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This data can be consumed in several ways:
* Through the [Linkerd CLI](../../reference/cli/), e.g. with `linkerd viz stat` and
`linkerd viz routes`.
* Through the [Linkerd dashboard](../dashboard/), and
[pre-built Grafana dashboards](../dashboard/#grafana).
[pre-built Grafana dashboards](../../tasks/grafana).
* Directly from Linkerd's built-in Prometheus instance

## Golden metrics
Expand Down
39 changes: 0 additions & 39 deletions linkerd.io/content/2.12/tasks/customize-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,42 +104,3 @@ and piping it to `kubectl apply`. For example you can run:
```bash
kubectl kustomize build . | kubectl apply -f -
```

## Modify Grafana Configuration

Interested in enabling authentication for Grafana? It is possible to
modify the `ConfigMap` as a one off to do this. Unfortunately, the changes will
end up being reverted every time `linkerd upgrade` happens. Instead, create a
file named `grafana.yaml` and add your modifications:

```yaml
kind: ConfigMap
apiVersion: v1
metadata:
name: grafana-config
data:
grafana.ini: |-
instance_name = grafana
[server]
root_url = %(protocol)s://%(domain)s:/grafana/
[analytics]
check_for_updates = false
```

Then, add this as a strategic merge option to `kustomization.yaml`:

```yaml
resources:
- linkerd.yaml
patchesStrategicMerge:
- grafana.yaml
```

Finally, apply this to your cluster by generating YAML with `kustomize build`
and piping the output to `kubectl apply`.

```bash
kubectl kustomize build . | kubectl apply -f -
```
3 changes: 2 additions & 1 deletion linkerd.io/content/2.12/tasks/exposing-dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ aliases = [

Instead of using `linkerd viz dashboard` every time you'd like to see what's
going on, you can expose the dashboard via an ingress. This will also expose
Grafana.
Grafana, if you have it linked against Linkerd viz through the `grafana.url`
setting.

{{< pagetoc >}}

Expand Down
71 changes: 71 additions & 0 deletions linkerd.io/content/2.12/tasks/grafana.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
+++
title = "Grafana"
description = "Grafana install instructions and how to link it with the Linkerd Dashboard"
+++

Linkerd provides a full [on-cluster metrics stack](../../features/dashboard)
that can be leveraged by a Prometheus instance and subsequently by a Grafana
instance, in order to show both the real-time and historical behavior of these
metrics.

First, you need to install Grafana from a variety of possible sources, and then
load the suite of Grafana dashboards that have been pre-configured to consume
the metrics exposed by Linkerd.

## Install Prometheus

Before installing Grafana, make sure you have a working instance of Prometheus
properly configured to consume Linkerd metrics. The Linkerd Viz extension comes
with such a pre-configured Prometheus instance, but you can also [bring your own
Prometheus](../external-prometheus).

## Install Grafana

The easiest and recommended way is to install Grafana's official Helm chart:

```bash
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
```

This is fed the default `values.yaml` file, which configures as a default
datasource Linkerd Viz' Prometheus instance, sets up a reverse proxy (more on
that later), and pre-loads all the Linkerd Grafana dashboards that are published
on <https://grafana.com/orgs/linkerd>.

A more complex and production-oriented source is the [Grafana
Operator](https://github.com/grafana-operator/grafana-operator). And there are
also hosted solutions such as [Grafana
Cloud](https://grafana.com/products/cloud/). Those projects provide instructions
on how to easily import the same charts published on
<https://grafana.com/orgs/linkerd>.

## Hook Grafana with Linkerd Viz Dashboard

In the case of in-cluster Grafana instances (such as as the one from the Grafana
Helm chart or the Grafana Operator mentioned above), you can configure them so
that the Linkerd Viz Dashboard will show Grafana Icons in all the relevant items
to provide direct links to the appropriate Grafana Dashboards. For example, when
looking at a list of deployments for a given namespace, you'll be able to go
straight into the Grafana Dashboard providing the same (and more) metrics (plus
their historical behavior) in the Linkerd Deployments Grafana Dashboard.

In order to enable this, just make sure a reverse proxy is set up, as shown in
the sample `grafana/values.yaml` file:

```yaml
grafana.ini:
server:
root_url: '%(protocol)s://%(domain)s:/grafana/'
```
And finally, refer the location of your Grafana service in the Linkerd Viz
`values.yaml` entry `grafana.url`. For example, if you installed the Grafana
offical Helm chart in the `grafana` namespace, you can install Linkerd Viz
through the command line like so:

```bash
linkerd viz install --set grafana.url=grafana.grafana:300 \
| kubectl apply -f -
```
8 changes: 5 additions & 3 deletions linkerd.io/content/2.12/tasks/multicluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ At a high level, you will:
granting extended privileges, so you'll need to be able to do that on your
test clusters.
- Linkerd's `viz` extension should be installed in order to run `stat` commands,
view the Grafana or Linkerd dashboard and run the `linkerd multicluster gateways`
view the Linkerd dashboard and run the `linkerd multicluster gateways`
command.
- Support for services of type `LoadBalancer` in the `east` cluster. Check out
the documentation for your cluster provider or take a look at
Expand Down Expand Up @@ -378,8 +378,10 @@ as well.
linkerd --context=west -n test viz stat --from deploy/frontend svc
```

We also provide a grafana dashboard to get a feel for what's going on here. You
can get to it by running `linkerd --context=west viz dashboard` and going to
We also provide a grafana dashboard to get a feel for what's going on here (see
the [grafana install instructions](../grafana) first to have a working grafana
provisioned with Linkerd dashboards). You can get to it by running `linkerd
--context=west viz dashboard` and going to
[http://localhost:50750/grafana/](http://localhost:50750/grafana/d/linkerd-multicluster/linkerd-multicluster?orgId=1&refresh=1m)

{{< fig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ linkerd-identity-data-plane
Some pods do not have the current trust bundle and must be restarted:
* linkerd/linkerd-controller-5b69fd4fcc-7skqb
* linkerd/linkerd-destination-749df5c74-brchg
* linkerd/linkerd-grafana-6dcf86b74b-vvxjq
* linkerd/linkerd-prometheus-74cb4f4b69-kqtss
* linkerd/linkerd-proxy-injector-cbd5545bd-rblq5
* linkerd/linkerd-sp-validator-6ff949649f-gjgfl
Expand Down
10 changes: 10 additions & 0 deletions linkerd.io/content/2.12/tasks/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,16 @@ helm delete linkerd-viz
helm install linkerd-viz -n linkerd-viz --create-namespace linkerd/linkerd-viz
```

### Removal of Grafana

Linkerd Viz no longer installs a Grafana instance, and instead we recommend you
install it directly from 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).
Linkerd's Grafana dashboards have been published in
<https://grafana.com/orgs/linkerd/dashboards>, and the new [Grafana
docs](../grafana) provide detailed instructions on how to load them.

## Upgrade notice: stable-2.11.0

The minimum Kubernetes version supported is `v1.17.0`. There are two breaking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ linkerd install --ignore-cluster | grep image: | sed -e 's/^ *//' | sort | uniq
For the current stable version, the output will be:

```bash
image: gcr.io/linkerd-io/controller:stable-2.6.0
image: gcr.io/linkerd-io/grafana:stable-2.6.0
image: gcr.io/linkerd-io/proxy-init:v1.2.0
image: gcr.io/linkerd-io/proxy:stable-2.6.0
image: gcr.io/linkerd-io/web:stable-2.6.0
image: prom/prometheus:v2.11.1
image: cr.l5d.io/linkerd/controller:stable-2.11.1
image: cr.l5d.io/linkerd/policy-controller:stable-2.11.1
image: cr.l5d.io/linkerd/proxy-init:v1.4.0
image: cr.l5d.io/linkerd/proxy:stable-2.11.1
```

All of the Linkerd images are publicly available in the
Expand Down
4 changes: 2 additions & 2 deletions linkerd.io/content/2.12/tasks/using-debug-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ title = "Control Plane Debug Endpoints"
description = "Linkerd's control plane components provide debug endpoints."
+++

All of the control plane components (with the exception of Grafana) expose
runtime profiling information through the path `/debug/pprof`, using Go's
All of the control plane components expose runtime profiling information through
the path `/debug/pprof`, using Go's
[pprof](https://golang.org/pkg/net/http/pprof/) package.

You can consume the provided data with `go tool pprof` to generate output in
Expand Down

0 comments on commit 6fd673e

Please sign in to comment.