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.
ConfigMap
and setting the variables from values files that are specific to each environment sounds like the way to go. – Emile Pels