helm-charts
helm-charts copied to clipboard
How to set dashboards using dashboard id from grafana website.
I want to have a grafana dashboard imported by default when i deploy grafana. The dashboard i am looking for is - https://grafana.com/grafana/dashboards/7353 i can import this via the following ID 7353
Is there a way i can specify this ID in my chart setup for grafana?
grafana:
persistence:
type: pvc
enabled: true
storageClassName: general
accessModes:
- ReadWriteOnce
size: 25Gi
finalizers:
- kubernetes.io/pvc-protection
nodeSelector:
acme/node-type: ops
adminPassword: <removed>
service:
type: NodePort
I can see in the documentation there are a number of fields relating dashboards
dashboardProviders
etc, but im not quite sure how i use these fields to get what i want.
I do not have experience with that specific topic. The easy workaround would be to download it as json. But there are options in the chart to download dashboard. You might want to try these or use the options in the sidecar section of the chart.
Can you point me to the option you are refering in the sidecar?
If you installed Grafana using the helm chart, you should be able to provision the dashboards during install, by including it under dashboardproviders and dashboards in your values like you mentioned yourself.
If you have not solved this yet, let me know and I can write up some example for you.
@deggja please provide an example I found this issue because I'm looking how to do it myself. I'm especially wondering how dashboardProviders supposed to look like as I'm not importing it from local filesystem like the given example.
@takeda You should be able to provision the dashboard by including this in your values:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: 'default'
orgId: 1
folder: 'default'
type: file
disableDeletion: true
editable: true
options:
path: /var/lib/grafana/dashboards/standard
dashboards:
default:
imported-dashboard-name:
gnetId: 7353
datasource: yourdatasource
Thanks, will try that.
BTW so type
still has to be file
and the path
needs to be provided? Those two things were confusing me the most.
Thanks, will try that.
BTW so
type
still has to befile
and thepath
needs to be provided? Those two things were confusing me the most.
Yes, I believe so. But you can play around with removing it and see what happens if you like. The configuration above is what I used in my last project, so it does at least work :-)
Dear @takeda, @deggja Could you kindly help me understanding why I cannot see my imported dashboard after deploying my helm chart?
It seems it downloads it correctly as I see it inside the POD but it's not later imported on Grafana:
grafana-bf964df7c-n56ch:~$ ls /var/lib/grafana/dashboards/default
jvm-micrometer.json
Here is my chart values:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-server
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: 'default'
orgId: 1
folder: 'default'
type: file
disableDeletion: true
editable: true
options:
path: /var/lib/grafana/dashboards/default
dashboards:
default:
jvm-micrometer:
gnetId: 4701
revision: 10
datasource: Prometheus
Thanks a lot
@danparisi The dashboardproviders.yaml
block must be nested under dashboardProviders
: https://github.com/grafana/helm-charts/blob/main/charts/grafana/values.yaml#L702
Similar for datasources.yaml
: https://github.com/grafana/helm-charts/blob/main/charts/grafana/values.yaml#L593