charts icon indicating copy to clipboard operation
charts copied to clipboard

Grafana with multiple replicas

Open danielcrisap opened this issue 3 years ago • 6 comments

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

danielcrisap avatar Jun 28 '22 13:06 danielcrisap

Are you using an external database as suggested by the message?

alemorcuq avatar Jul 04 '22 10:07 alemorcuq

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.

danielcrisap avatar Jul 04 '22 13:07 danielcrisap

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

danielcrisap avatar Jul 05 '22 18:07 danielcrisap

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!

alemorcuq avatar Jul 06 '22 09:07 alemorcuq

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!

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

junkiebev avatar Jul 19 '22 20:07 junkiebev

I opened a PR with the latest fix suggestions https://github.com/bitnami/charts/pull/11343

danielcrisap avatar Jul 25 '22 17:07 danielcrisap

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.

github-actions[bot] avatar Aug 21 '22 01:08 github-actions[bot]

Is this sorted? I believe there were some issues with duplicate PRs

junkiebev avatar Aug 22 '22 16:08 junkiebev

All the PRs were merged, so it would be safe to say that the issue was sorted out.

javsalgar avatar Aug 23 '22 11:08 javsalgar

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.

danielcrisap avatar Aug 23 '22 12:08 danielcrisap