Has anyone configured high availability for Grafana using database as a backend?
Can someone please help me understand the HA configuration? The documentation says
First, you need to set up MySQL or Postgres on another server and configure Grafana to use that database. You can find the configuration for doing that in the [database] section in the Grafana config. Grafana will now persist all long term data in the database. How to configure the database for high availability is out of scope for this guide. We recommend finding an expert on the database you're using.```
[https://grafana.com/docs/grafana/latest/setup-grafana/set-up-for-high-availability/](https://grafana.com/docs/grafana/latest/setup-grafana/set-up-for-high-availability/)
Hey
it’s fairly simple as it said in documentation.
Just setup DB (in My case it’s Postgres RDS)
and spawn multiple grafana replicas.
change Your grafana.ini
database:
type: postgres
ssl_mode: require```
I have grafana in k8s so credentials for DB are taken from secrets as ENV
There is settings in helm:
```envFromSecrets:
- name: grafana-main
optional: false
- name: grafana-rds
optional: false
- name: grafana-okta
optional: false```
```- apiVersion: [kubernetes-client.io/v1](http://kubernetes-client.io/v1)
kind: ExternalSecret
metadata:
name: grafana-rds
spec:
backendType: secretsManager
data:
- key: /monitoring/integration/grafana/rds
name: GF_DATABASE_HOST
property: hostname
- key: /monitoring/integration/grafana/rds
name: GF_DATABASE_USER
property: username
- key: /monitoring/integration/grafana/rds
name: GF_DATABASE_PASSWORD
property: password
- key: /monitoring/integration/grafana/rds
name: GF_DATABASE_NAME
property: sql_db_name```
For grafana persistent storage are you also using EFS or just ebs pvc (along with rds postgres) ?
I’m also running Grafana as a pod in a k8s cluster similarly to you in aws
Thank you. I will try this.
I don’t have any persistence for grafana except external RDS
- configMap:
defaultMode: 420
name: grafana
name: config
- emptyDir: {}
name: storage
- emptyDir: {}
name: sc-dashboard-volume
- configMap:
defaultMode: 420
name: grafana-config-dashboards
name: sc-dashboard-provider```
dashboards are stored as ConfigMaps and synced by sidecar