However, since the plan is to install grafana on k8s, is it possible to use a pvc instead of a database? If all the grafana pods will share the same pvc, wouldn’t that replace the need for a database? The storage class the pvc will use can handle multiple process access to files (sort of like an NFS).
Has anyone successfully deployed grafana in a HA setup on k8s with only a pvc?
We are excited that you joined our OSS community. Please read about some of the FAQs in the community
I talked to the Engineering folks and the short answer is that Grafana does need a Database.
Grafana needs a database. SQLite stores its DB on disk and thus can be stored in a PVC.
However, PVCs are per pod, so you can’t (generally) mount a PVC onto two instances. Then, there’s the fact that an SQLite database isn’t designed for concurrent writes, so even if you did, you’d get yourself into trouble.
I’ll look into what DB to use.
If I point Grafana to use for example a postgres StatefulSet cluster as its DB (which will have its own pvc for saving DB data over pod restarts), does this mean I can disable persistence in Grafana’s values.yaml?
Or is persistence still required if I want to save dashboards and alerts across Grafana pod restarts for a HA setup, assuming I enable persistence with pvc instead of using the sidecar+configMaps option?