<p>Could you please let me know, How should I deploy a grafana dashboard with sidecar and place/group it in specific dashboard folder? </p>

<p>Example ( Mongo DB dashboard resides in Mongo Folder and Postgres at Postgres Folder). Please note that I am NOT talking about file locations ( /tmp/dashboards ).</p>

<p>I am using the grafana stable HELM chart and latest version of grafana (version 6.4.2) </p>

<p>I am deploying JSON dashboards with k8s configmap and label the config map with sidecar dashboard label. Once deployed it always goes to default "General" dashboards Folder. </p>

<p>HRLM values</p>

<pre><code>  sidecar:
    dashboards:
      enabled: true
      label: grafana_dashboard
</code></pre>

<p>THANKS</p>

Dileeka Fernando
<p>You can add dashboard Providers to your values file and specify custom configurations for each of your folders.</p>
<p>You can check the default values for Grafana chart to find an <a href="https://github.com/grafana/helm-charts/blob/main/charts/grafana/values.yaml#L525" rel="nofollow noreferrer">example</a>.</p>
<p>The <code>dashboardProviders</code> should be under <code>grafana</code>, same indentions as <code>sidecar</code>.</p>
<p>Example :</p>
<pre><code>grafana:
  dashboardProviders:
    dashboardproviders.yaml:
      apiVersion: 1
      providers:
      - name: folder1
        orgId: 1
        type: file
        folder: folder1
        allowUiUpdates: true
        disableDeletion: false
        updateIntervalSeconds: 10
        editable: true
        options:
          path: /tmp/dashboards/folder1
      - name: folder2
        orgId: 1
        type: file
        folder: folder2
        allowUiUpdates: true
        disableDeletion: false
        updateIntervalSeconds: 10
        editable: true
        options:
          path: /tmp/dashboards/folder2
      - name: folder3
        orgId: 1
        type: file
        folder: folder3
        allowUiUpdates: true
        disableDeletion: false
        updateIntervalSeconds: 10
        editable: true
        options:
          path: /tmp/dashboards/folder3
</code></pre>
<p>Then you can add an annotation to each of your dashboards configmaps to tell helm chart where to place those dashboards :</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: name-of-dashboard
  labels:
    grafana_dashboard: &quot;1&quot; #
  annotations:
    k8s-sidecar-target-directory: /tmp/dashboards/folder1
</code></pre>
<p>This annotation will tell helm to place the target dashboards under /tmp/dashboards/folder1 so that they can be managed by folder1 provider.</p>
