I am deploying grafana to kubernetes using a custom helm chart. A custom grafana.ini file is copied to the docker image when it is built, the grafana.ini file contains the RDS instance connection config and various custom auth settings. This is not ideal when I bring more than one environment into the mix, as each build will require a different grafana.ini file, and I want to use the same base docker image. It's also not secure.
I have three kubernetes clusters, dev, preprod and prod. The crucial differences will be the RDS configuration.
What is the best way of binding a grafana.ini file to a certain build of grafana, based on the environment. Can I use some kind of parametised configMap?
I am using helmfile to deploy the helm chart, so I am familiar with the concept of having seperate values.yaml files for each environment and setting an environment variable to target the right one.
You can mount a configmap as volume in the pod.
An example:
Deployment:
In this example the configmap data will be mounted on path:
/usr/src/metis/config/
and will create the fileclients_db_config.yaml
which can also be a .ini