-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
dashboards.<name>.file creates empty ConfigMap #27
Comments
Same issue here. |
Even using a dashboard id i have an empty configmap
|
Same And I'm really struggling to create a config map holding the dashboard defintion, as I'm using Helm and the |
Signed-off-by: Reinhard Nägele <[email protected]>
Signed-off-by: Reinhard Nägele <[email protected]>
I only used sidecar provisioning provided by this chart before. But today, I just wanted to install a minimal Grafana instance without sidecars and with a few file and imported dashboards. I spent like an hour figuring out what’s going on 😒 File-based dashboards: @mozai, I believe you are right about the template not being able to access files outside of the chart package: there is an old open issue in the Helm repo. On the bright side, sidecar-injected dashboards and datasources seem to be working great. Imported dashboards ( @tzouin, I think your issue is different. There is another config map containing a generated script to download The reason it did not work is that the chart does not define a dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: istio
orgId: 1
folder: Istio
type: file
options:
path: /var/lib/grafana/dashboards/istio
dashboards:
istio: # this key should match the provider name above
mesh:
gnetId: 7639
revision: 43
datasource: default
#... |
@uvw i missed your answer but that's it ! Thanks you |
Same issue here. |
I see there have been no comments on here in a while, and I mentioned this over on #764, but one way you can work around this is using
|
@uvw, thanks for the detailed comment above. It was really useful to me. As per your advice, I am trying to add a dashboard using sidecar approach. The dashboard is added to grafana but I am unable to over-ride the datasource. Here is how i was able to over-ride the datasource for opensource dashboards. But when it comes to sidecar, It doesn't seem to be able to take in
|
I think this ticket is duplicated with the #2596. As far as I could debug, it seems the ConfigMap that reads the file, is actually only checking for the file in the Helm package. So, it only reads this file. If you clone this repo and try to deploy locally, like helm upgrade \
--atomic \
--timeout 2m \
--cleanup-on-fail \
--force \
--install grafana \
-f values.yaml \
./ Then it will work fine, but if you point it to I couldn't find a way to get this. I'll open a ticket with Helm to see if they know how to do it and I'll share it here. The issue opened with the Helm docs here. |
In the documentation for Import dashboards it gives this example for importing a file from local filesystem (near the values.yaml file, I would assume).
When trying this myself with helm2 and helm3, it results in a ConfigMap with empty values.
Below are the steps I took when trying to use this feature of the helmchart.
empty-dashboard.json is just
{}
which is a copy of the example "dashboards/custom-dashboard.json" already in this git repository.Launching
helm install --dry-run grafana grafana/grafana -f values.yaml --debug
shows the ConfigMap that would be sent to the cluster would have empty values for the dashboards, instead of the file contents.If I install this without the
--dry-run
the ConfigMap I find is indeed empty, and grafana complains about being unable to load these dashboards.Bizarrely, if I add
custom-dashboard: {file: dashboards/custom-dashboard.json}
exactly as it appears in the example documentation, this results in a non-empty ConfigMap, even though there is no such file "dashboards/custom-dashboard.json" on my local filesystem.Maybe the
{{.Files.Get "filename"}}
in the template cannot access files outside of the helmchart package itself?The text was updated successfully, but these errors were encountered: