I am trying to get kube prometheus stack's grafana dashboard sidecar to deploy dashboards depending on the environment (dev, staging, prod, all environments). I can't quite figure out a good way to do this.
My folder structure currently looks like such:
kube-prometheus-stack
charts
grafana
templates
env
dev
dashboard1-cm.yaml
dashboard2-cm.yaml
staging
prod
all-environments
I'd like to deploy dev dashboards to dev, staging to staging and so on.
I've been browsing https://github.com/kiwigrid/k8s-sidecar but haven't been able to figure out a good pattern to handle this.
Curious how others are doing this.
I have tried just one simple thing:
add the placement for the specific location of the dashboards in that folder to the specific
value-env.yaml
In yaml associated with specific dashboard (
mqtt2.yaml
) I havesurronding previos config to exclude it if
.alpha
property isnt setupgrading helm for the specific env with passing the specific config for that:
For me it works and now I'm able ho have different dashboards at the different envs. Also note,
dashboards-1.14
folder still have all dashboards being still deployed even after the sidecar configuration update, so move all dashboards from justdashboards
to it, while have set up other folders to store data instead of generic just dashboards to some env-specific like minedashboards-alpha
.