IBM / varnish-operator

Run and manage Varnish clusters on Kubernetes
https://ibm.github.io/varnish-operator/
Apache License 2.0
70 stars 26 forks source link

Provide alternative ways to get grafana dashboard #40

Open arthurzenika opened 3 years ago

arthurzenika commented 3 years ago

Hi :wave:

Great to see that there is a way to deploy a grafana dashboard https://ibm.github.io/varnish-operator/monitoring.html for the varnish-operator.

It would be nice to have a "I already have a grafana somewhere else" option with the json one could copy/paste to create the dashboard. Or even publish the said json on https://grafana.com/grafana/dashboards

arthurzenika commented 3 years ago

Tried to copy paste the json found in https://github.com/IBM/varnish-operator/blob/main/varnish-operator/templates/grafana-dashboard.yaml#L11 (without the first 10 lines). Not sure what I was doing but tried to cut out the bits that we're considered json by my editor and then created the dashboard. It creates it, need to figure out why it's not showing data yet.

allen-servedio commented 3 years ago

You may want to try rendering the template with Helm (helm template) so that all of the template replacement happens. Just be sure to feed it the right values (like the release name) so that it will name things properly.

tomashibm commented 3 years ago

Hello, glad to see it's being useful!

So there are two dashboards the operator can deploy:

  1. Operator dashboard, that shows how the operator (not the VarnishCluster) operates (memory, cpu usage, etc). It is deployed with the helm chart and you should be able to extract it in the way Allen suggests.
  2. VarnishCluster dashboards that show metrics for the deployed clusters. They are deployed by the operator's code per cluster. It is also templated so just copy/paste won't work. But you can deploy a cluster with the dashboard enabled in the spec and it will create a configMap with the final json file. You can use it to extract the dashboard and modify to your needs.

That's for the time being. Meanwhile we'll consider a way to provide those dashboards in a more convenient way for such use cases.