<p>I am using <strong>Helm</strong> as for <strong>Kubernetes</strong> deployment (Grafana and Prometheus) specifically. I have specified <strong>values.yaml</strong> files for both of them. It works amazingly.</p>

<p>Since I have changed <strong>Grafana</strong> datasource from default <strong>sqlite3</strong> to <strong>PostgreSQL</strong> - data-source configuration is now stored in <strong>PostgreSQL database</strong>.</p>

<p>Well, the problem is that in my <strong>values.yaml file* for **Grafana</strong> I have specified datasource as following:</p>

<pre><code>datasources: {}
datasources.yaml:
  apiVersion: 1
  datasources:
  - name: on-premis
    type: prometheus
    url: http://prom-helmf-ns-monitoring-prometheus-server
    access: direct
    isDefault: true
...
...


grafana.ini:
  paths:
    data: /var/lib/grafana/data
    logs: /var/log/grafana
    plugins: /var/lib/grafana/plugins
  analytics:
    check_for_updates: true
  log:
    mode: console
  grafana_net:
    url: https://grafana.net
  database:
  ## You can configure the database connection by specifying type, host, name, user and password
  ## # as separate properties or as on string using the URL property.
  ## # Either "mysql", "postgres" or "sqlite3", it's your choice
    type: postgres
    host: qa.com:5432
    name: grafana
    user: grafana
    # If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
    password: passwd
    ssl_mode: disable
</code></pre>

<p>Unfortunately this does not take an effect and I have to configure connection to in <strong>Grafana web interface</strong> manually - which is not what I need. How do I specify this section correctly?</p>

<pre><code>datasources: {}
datasources.yaml:
  apiVersion: 1
  datasources:
  - name: on-premis
    type: prometheus
    url: http://prom-helmf-ns-monitoring-prometheus-server
    access: direct
    isDefault: true
</code></pre>

<p>remove '{}' after section datasources.
like this </p>

<pre><code>    datasources:
      datasources.yaml:
        apiVersion: 1
        datasources:
        - name: Prometheus
          type: prometheus
          url: http://prometheus-server
          access: proxy
          isDefault: true
</code></pre>
