<p>As the title indicates I'm trying to setup grafana using helmfile with a default dashboard via values.</p>

<p>The relevant part of my helmfile is here</p>

<pre><code>releases:
...
  - name: grafana
    namespace: grafana
    chart: stable/grafana
    values:
      - datasources:
          datasources.yaml:
            apiVersion: 1
            datasources:
              - name: Prometheus
                type: prometheus
                access: proxy
                url: http://prometheus-server.prometheus.svc.cluster.local
                isDefault: true
      - dashboardProviders:
          dashboardproviders.yaml:
            apiVersion: 1
            providers:
            - name: 'default'
              orgId: 1
              folder: ''
              type: file
              disableDeletion: false
              editable: true
              options:
                path: /var/lib/grafana/dashboards
      - dashboards:
            default:
              k8s:
                url: https://grafana.com/api/dashboards/8588/revisions/1/download
</code></pre>

<p>As far as I can understand by reading <a href="https://github.com/plotly/helm-charts/blob/master/stable/grafana/values.yaml#L125" rel="nofollow noreferrer">here</a> I need a provider and then I can refer to a dashboard by url. However when I do as shown above no dashboard is installed and when I do as below (which as )</p>

<pre><code>      - dashboards:
          default:
            url: https://grafana.com/api/dashboards/8588/revisions/1/download
</code></pre>

<p>I get the following error message</p>

<pre><code>Error: render error in "grafana/templates/deployment.yaml": template: grafana/templates/deployment.yaml:148:20: executing "grafana/templates/deployment.yaml" at &lt;$value&gt;: wrong type for value; expected map[string]interface {}; got string
</code></pre>

<p>Any clues about what I'm doing wrong?</p>

user672009
<p>I think the problem is that you're defining the datasources, dashboardProviders and dashboards as lists rather than maps so you need to remove the hyphens, meaning that the values section becomes:</p>

<pre><code>values:
  datasources:
    datasources.yaml:
      apiVersion: 1
      datasources:
      - name: Prometheus
        type: prometheus
        url: http://prometheus-prometheus-server
        access: proxy
        isDefault: true
  dashboardProviders:
    dashboardproviders.yaml:
      apiVersion: 1
      providers:
      - name: 'default'
        orgId: 1
        folder: ''
        type: file
        disableDeletion: false
        editable: true
        options:
          path: /var/lib/grafana/dashboards
  dashboards:
    default:
      k8s:
        url: https://grafana.com/api/dashboards/8588/revisions/1/download
</code></pre>

<p>The grafana chart <a href="https://github.com/plotly/helm-charts/blob/master/stable/grafana/values.yaml#L100" rel="nofollow noreferrer">has them as maps</a> and <a href="https://github.com/cloudposse/helmfiles/blob/master/helmfiles/grafana.yaml#L40" rel="nofollow noreferrer">using helmfile doesn't change that</a></p>
