grafana / helm-charts

Apache License 2.0
1.66k stars 2.28k forks source link

Grafana Dashboards multi org #544

Open davidphay opened 3 years ago

davidphay commented 3 years ago

Hello,

I want to configure through helm my grafana dashboard.

I have multiple org and I can't found how to define a dashboard (inside a configmap) to a specific org.

I found 2 post about that, but it doesn't work, maybe I did something wrong?

For information I use the helm chart kube-prometheus-stack-prometheus and this is my configuration for grafana:

grafana:
  dashboardProviders:
    dashboardproviders.yaml:
      apiVersion: 1
      providers:
        - name: 'default'
          orgId: 1
          folder: ''
          type: file
          disableDeletion: false
          editable: true
          options:
            path: /tmp/dashboards/org1
        - name: 'org2'
          orgId: 2
          folder: ''
          type: file
          disableDeletion: false
          editable: true
          options:
            path: /tmp/dashboards/org2
  sidecar:
    image:
      repository: quay-remote.artifactory.swisscom.com/kiwigrid/k8s-sidecar
    dashboards:
      enabled: true
      label: grafana_dashboard
      folder: /tmp/dashboards

      ## Annotations for Grafana dashboard configmaps
      ##
      annotations: {}
      multicluster: false

and on my configmap:

apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    grafana_dashboard: "1"
  name: traefik-test
  annotations:
    k8s-sidecar-target-directory: "/tmp/dashboards/org2"
data:
  traefik-test.json: |-
    {
      ...
      ...
    }

Thanks, David

davidphay commented 3 years ago

Hello, anyone can help me ?

zucher commented 3 years ago

Hi @davidphayanouvong , I have the same issue, on of the path could to use en external DB, and create manually the org entry before grafana startup with a dedicated mysql client script

but not yet tested