<p>I'm using Grafana with Helm <a href="https://github.com/grafana/helm-charts/tree/main/charts/grafana" rel="nofollow noreferrer">https://github.com/grafana/helm-charts/tree/main/charts/grafana</a>. I would like to switch from SQLite 3 to PostgreSQL as my backend database. However, I'm concerned about the security of my database credentials, which are currently stored in the values.yaml file as plain text.</p>
<p>What is the recommended way to switch to PostgreSQL and hide the database credentials in a secure way? Can I use Kubernetes secrets or some other mechanism to achieve this? (Please I need to know where, in the values.yaml file, I have to do the configuration)</p>
<p>I'm connecting Grafana with the PostgreSQL database inside the grafana.ini section in the values.yaml, E.g.:</p>
<pre><code>grafana.ini:
  database:
    type: &quot;postgres&quot;
    host: &quot;db.postgres.database.azure.com&quot;
    name: &quot;grafana-db&quot;
    user: &quot;grafana-db-user&quot;
    password: &quot;&quot;grafana-db-pass&quot;
    ssl_mode: &quot;require&quot;
</code></pre>
<p>Thanks in advance for your help!</p>
<p>I've tried to include use the env section but it's not working.</p>

Julio Enrique Guzmán Barraza
<blockquote>
<p>Had you already seen this section from your link? How to securely reference secrets in grafana.ini –
jordanm</p>
</blockquote>
<p>Thank you so much @jordanm :)</p>
