Search code examples
mysqlkubernetesgrafana

Does Grafana allow mysql as its backend in kubernetes?


I am trying to setup grafana on kubernetes and need to use mysql as its backend to store dashboards and its config instead of persistent volume. Is there any way around to achieve it?

Tried grafana helm charts expecting any variable to use mysql as backend but could not find any.


Solution

  • Yes Grafana supports the Mysql, Postgress

    https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#database

    You can set the value at grafana.ini

    https://github.com/grafana/helm-charts/blob/main/charts/grafana/values.yaml#L682

    grafana.ini:
        database:
          type: mysql
          host: ${host}
          user: ${username}
          password: ${password}
    

    if looking forward to set environment variables

    GF_DATABASE_TYPE=mysql
    GF_DATABASE_HOST=host
    GF_DATABASE_USER=username
    GF_DATABASE_PASSWORD=password