grafana-operator
grafana-operator copied to clipboard
New `grafanafolder#spec.uid` property for stable UIDs
I'm in the middle of defining a disaster-recovery process when recreating the Grafana Operator resources from scratch.
If I lose my cluster, ETCD state, or I mess up in a CD pipeline and any grafanafolder cr is deleted.
Recreating it results in an entirely new metadata.uid
.
Currently, the only way to recover from this is through manually/programmatically:
- Connect to every managed instance with the deleted folder
- Delete all provisioned Alertrules and Dashboards
- Delete the existing folder with the old UID
- Have Grafana-Operator recreate the Folder, Alertrules, and Dashboards
Describe the solution you'd like UID property on grafanafolder resource to ensure it's always the same for a specific folder name.
Describe alternatives you've considered
- Using
folderUID
on Alertrules/Dashboards This could work, except when onboarding new Grafana instances the folder does not exist and I cannot create the dashboards - Using
folder
The folder will always have a different UID for each Grafana Instance. This could work, both when provisioning and Deleting. It does however mean I cannot use thefolderRef
andfolderUID
properties on Alertrules and Dashboards and the grafanafolder crd. - I have tried "Tricking" the operator by applying a GrafanaFolder with the
metadata.uid
already specified, but it's overwritten on first apply.