Improve configuration Prometheus rules deployment

When managing multiple workload clusters, almost the same rules apply to all of them, but the current way of configuring that is to create a directory for each one (with the name <cluster_name>) in the alert-rules directory in sylva-prometheus-rules repository

https://gitlab.com/sylva-projects/sylva-elements/helm-charts/sylva-prometheus-rules

This is then used up in the sylva-prometheus-rules unit:

units:
  sylva-prometheus-rules:
    helmrelease_spec:
      values:
        createRules:
          allclusters: true
          '{{ .Values.cluster.name }}': true # add specific rules for a cluster

This leads to unnecessary work to set up and keep rules in sync.

A better way would be to add all workload clusters rules in the allclusters directory with conditionals for the deployed components, similarly to how we deploy Grafana dashboards: https://gitlab.com/sylva-projects/sylva-elements/helm-charts/sylva-dashboards/-/blob/main/values.yaml?#L8 and https://gitlab.com/sylva-projects/sylva-core/-/blob/main/charts/sylva-units/values.yaml?L4173

Assignee Loading
Time tracking Loading