Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strategies for installing Grafana separately and loading dashboards #7358

Closed
alpeb opened this issue Nov 25, 2021 · 4 comments
Closed

Strategies for installing Grafana separately and loading dashboards #7358

alpeb opened this issue Nov 25, 2021 · 4 comments
Assignees
Labels
Milestone

Comments

@alpeb
Copy link
Member

alpeb commented Nov 25, 2021

Ref #6045

We'd like to stop providing a docker image based on Grafana, given their license changes.
We could instruct users to install Grafana directly through their Helm chart:

helm repo add grafana https://grafana.github.io/helm-charts
helm install grafana -n grafana --create-namespace grafana/grafana -f https://github.com/linkerd/linkerd2/blob/main/grafana/values.yaml

where values.yaml would be a new file with the default config needed to hook that Grafana instance with Linkerd (pointing to viz' Prometheus and discoverable by web).

The challenge is how to load our default dashboards. I can think of these options:

1) Upload all the charts to https://grafana.com/grafana/dashboards/

We'd only have to add this to values.yaml to point to those charts, which would be fetched automatically:

dashboards:
  default:
    # all these charts are hosted at https://grafana.com/grafana/dashboards/{id}
    top-line:
      gnetId: 14276
      revision: 1
      datasource: prometheus
    deployment:
      gnetId: 14264
      revision: 1
      datasource: prometheus
    pod:
      gnetId: 14269
      revision: 1
      datasource: prometheus
    ...

We could still keep the dashboard definitions versioned in the linkerd2 repo under /grafana/dashboards, warning folks that those files would need to remain in sync with what gets uploaded to grafana.com.

2) Include the dashboard definitions inside values.yaml

The downside here is that it'd end up being a huge file, and we wouldn't be able to track changes in git separately for each dashboard.

3) Separate dashboard definitions into ConfigMaps

Create a new Helm chart linkerd-grafana-dashboards with a ConfigMap for each dashboard. The values.yaml mentioned above would have the settings necessary to wire thes CMs. Possibly a new linkerd viz grafana-dashboards command could be created to render all those CMs as well.

4) linkerd-grafana extension

As suggested originally in #6045, we could still provide our own Grafana image loaded with all the dashboards, based on an up-to-date upstream Grafana image, as long as provide it through a separate linkerd extension

Thoughts?

@alpeb alpeb added the rfc label Nov 25, 2021
@adleong adleong added this to the stable-2.12.0 milestone Nov 30, 2021
@olix0r
Copy link
Member

olix0r commented Nov 30, 2021

All things equal, I'm a fan of the first option (publishing the dashboards to grafana's service). Otherwise, we'd probably be best going with option 4 (splitting this all out into another extension).

@jack1902
Copy link

jack1902 commented Dec 7, 2021

@alpeb to throw a 5th contender into the ring. Would it be possible to add https://github.com/grafana-operator/grafana-operator templates with a boolean wrapper (off by default) which point to configMapRefs which are created by point 3.

This means that you still get all the benefits of 3 for git tracking of individual dashboards, whilst making it possible to add the dashboards to an existing grafana deployment that is managed by the grafana-operator without needing to wire them into whichever deployment of grafana people are using

@alpeb
Copy link
Member Author

alpeb commented Dec 9, 2021

@jack1902 You mean our chart would produce GrafanaDashboard CRs instead of ConfigMaps, if enabled by some new flag? Or even better, do you know if there's a way for the grafana operator to consume ConfigMaps instead of GrafanaDashboard instances?

alpeb added a commit that referenced this issue Jan 6, 2022
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.
alpeb added a commit that referenced this issue Jan 11, 2022
* 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.
@alpeb
Copy link
Member Author

alpeb commented Jan 11, 2022

Fixed by #7567

@alpeb alpeb closed this as completed Jan 11, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants