Deploying Grafana as a Kubernetes deployment instead of statefulset safely

Is it possible to grafana as kubernetes deployment instead of statefulset. Will there be any data loss. Can somebody pls confirm

Using a Kube deployment alone without an eternal DB or persistent volume will result in data loss because Grafana’s local DB will be placed on container isolated storage that is deleted everytime pods are rolled.

You can technically use persistent volumes with deployments but that goes against Kube best practices.

But wont it pull data from prometheues again in new pod comes up if case of deployment. Can you pls share what kind of data will be deleted and is there no recovery for it ? If my data is secured with prometheus stateful set, then is grafana storing its own version of metrics

Grafana has a DB that contains datasource configs, dashboards, folders, users etc. That’s the information you’d lose if its DB is deleted.

You can define some of these as config as code but you’d have to make sure nothing you want to keep is every created in Grafana and not converted to committed config.