Grafana with multiple replicas
Name and Version
bitnami/grafana 7.9.8
What steps will reproduce the bug?
I'm using Grafana with multiple replicas and recently during an update helm chart started falling with the below message
Error: execution error at (grafana/templates/NOTES.txt:33:3):
VALUES VALIDATION:
grafana: replicaCount
Using more than one replica requires using an external database to share data between Grafana instances.
By default Grafana uses an internal sqlite3 per instance but you can configure an external MySQL or PostgreSQL.
Please, ensure you provide a configuration file configuring the external database to share data between replicas.
Use --debug flag to render out invalid YAML
Are you using any custom parameters or values?
helm template grafana bitnami/grafana --set grafana.replicaCount=2
What is the expected behavior?
Just having the notes release message without failing the template render.
What do you see instead?
➜ helm template grafana bitnami/grafana --set grafana.replicaCount=2
Error: execution error at (grafana/templates/NOTES.txt:33:3):
VALUES VALIDATION:
grafana: replicaCount
Using more than one replica requires using an external database to share data between Grafana instances.
By default Grafana uses an internal sqlite3 per instance but you can configure an external MySQL or PostgreSQL.
Please, ensure you provide a configuration file configuring the external database to share data between replicas.
Use --debug flag to render out invalid YAML
Additional information
PR that contributes to the bug https://github.com/bitnami/charts/pull/10411 https://github.com/bitnami/charts/pull/10372
that fail function displaying a message that causes the bug.
https://github.com/bitnami/charts/blob/master/bitnami/grafana/templates/_helpers.tpl#L140
Are you using an external database as suggested by the message?
Are you using an external database as suggested by the message?
Yes, I'm using an external DB and I didn’t find a way to not print this message I'm ingesting the DB information by environment variables, securing by Hashicorp Vault.
The only way I've thought of solving this while keeping the message is to have an externalDb: true value and include it in the _helps.tlp condition to avoid prompting the message when not needed.
Is it ok to have this value? I could open PR with the feature
Yes, I think that would be the best solution. The grafana.validateValues.database helper function should also check for an external database and not throw the error if it is set.
PRs are very welcome, thanks!
Yes, I think that would be the best solution. The
grafana.validateValues.databasehelper function should also check for an external database and not throw the error if it is set.PRs are very welcome, thanks!
The problem is that there are about 4 different ways I can think of off the top of my head to set the value, and no way to check if the value is "valid".
I would argue that the best path forward is to add a section to Notes if replicas > 1 instead of doing validation as pass/fail where it will always fail if replicas > 1
I opened a PR with the latest fix suggestions https://github.com/bitnami/charts/pull/11343
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
Is this sorted? I believe there were some issues with duplicate PRs
All the PRs were merged, so it would be safe to say that the issue was sorted out.
This PR wasn’t merged https://github.com/bitnami/charts/pull/11620. The previous one, https://github.com/bitnami/charts/pull/11343, I closed by mistake when I was fixing the conflict.