-
What Grafana version and what operating system are you using?
9.4.1 over Kubernetes
-
What are you trying to achieve?
I’m trying to assign OrgID to dashboards that I’m adding to dashboardsConfigMaps.
-
How are you trying to achieve it?
I know that if I set up an dashboard in dashboardproviders, I can set the orgId. But if i use a configmap to use a custom dashboard, I must use dashboardsConfigMaps. How can I set the orgID in this way?
I have this config:
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: "default"
orgId: 1
folder: ""
disableDeletion: true
editable: true
options:
path: /var/lib/grafana/dashboards/default
- name: "client 1"
orgId: 2
folder: ""
disableDeletion: true
editable: false
options:
path: /var/lib/grafana/dashboards/default
- name: "client 2"
orgId: 3
folder: ""
disableDeletion: true
editable: false
options:
path: /var/lib/grafana/dashboards/default
dashboardsConfigMaps:
my-org: "my-org-dashboards"
Hi @tupacsoul,
Thanks for opening this post.
I think you are trying to do the Dashboard Provisioning via HELM Charts.
You can check some of the following post which could be helpful as how to set the OrgID correctly:
-
How to upload dashboards as .json files to kubernetes via helm
-
How to provision a dashboard from grafana.com/dashboards when deploying Grafana using the Helm chart?
Let us know if this helps.
I’ve found them before opening the thread. It’s not really helpful.
I need to assign OrgID to a dashboard loaded from configmap
Thanks for your reply and feedback.
I am not too expert with Helm but I am sure that other community members might be able to help you out. I have added some more tags to this post to get more visibility.
1 Like
dashboardConfigMaps still requires providers.
You see to have a misunderstanding of the keys here.
dashboardsConfigMaps:
my-org: "my-org-dashboards"
You do not have a my-org
provider, so this will fail. Key structure under dashboardsConfigMaps
is provider-name: config-map-name
So in your case you want:
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: "default"
orgId: 1
folder: ""
disableDeletion: true
editable: true
options:
path: /var/lib/grafana/dashboards/default
- name: "client-1"
orgId: 2
folder: ""
disableDeletion: true
editable: false
options:
path: /var/lib/grafana/dashboards/default
- name: "client-2"
orgId: 3
folder: ""
disableDeletion: true
editable: false
options:
path: /var/lib/grafana/dashboards/default
dashboardsConfigMaps:
default: "org-1-dashboards"
client-1: "org-2-dashboards"
client-2: "org-3-dashboards"
All the dashboards for a provider need to be in a single configmap from what I can tell but I’m also still advancing my understanding for this configuration. For sanity purposes you can maintain a directory of dashboard json files in your version control and inject them into the configMap using the “Create ConfigMaps from files” method: