| Pavel Sturc Good approach... We actually need something very very similar at the sync side now. As we now support multiple instances of sync apps in a namespace, we need to create the Grafana dashboard per sync app. There we need to support the same scenario. But the more problematic part there is, we don't know the "temporary" config map there. We would probably append the sync app name to the config map and we need to patch the {[grafana-dashboards-configmap}} with them. Steps: Steps During keycloak-apb provision with sync app name "foo":
- create sync-dashboard-foo configmap from json file *template* (if previous instance of sync-app-apb hasn't created it yet with the same name) or if grafana-dashboards-configmap doesn't exist
If grafana-dashboards-configmap exists(i.e. metrics-apb is already provisioned), patch it immediately with the template.
I am telling "template" here as we will have some references in the dashboard to the sync app name. We need to convert them to placeholders. e.g. this line During metrics-apb provision
- create grafana-dashboards-configmap
- iterate over the sync-dashboard-* configmaps
- Patch grafana-dashboards-configmap configmap with sync-dashboard-xyz configmap content and delete sync-dashboard-xyz configmap from project
|