Skip to content

Fix workload cluster Grafana UI

Bogdan Antohe requested to merge test-bantohe into main

What does this MR do and why?

I've noticed following error into kyverno logs and this has a negative effect on monitoring chart in workload cluster because the clusterId is not injected into helmrelease caused "404 error" in grafana UI.


E0305 10:47:22.009283       1 mutate.go:165] "" err="failed to mutate existing resource, rule inject-cluster-id, response error: : helmreleases.helm.toolkit.fluxcd.io \"monitoring\" not found" logger="background" name="ur-dn62c" policy="set-monitoring-chart-cluster-id" resource="provisioning.cattle.io/v1/Cluster/test-cluster/test-cluster-capi"
I0305 10:47:22.009343       1 mutate.go:232] "cannot generate events for empty target resource" logger="background.mutateExisting" policy="set-monitoring-chart-cluster-id" rule="inject-cluster-id

Once the capi-import resource is generated the kyverno policy is triggered and try to mutate the monitoring helmrelease which is not present on that time and the resource is deployed without values submited by the rule.

Actual MR brings a new way to introduce values into monitoring chart by generate a configMap via Kyverno policy which will contain information about cluster.

To overcome possible error that could appear on monitoring UIs I've introduce new test cases into hurl to check the accessibility, in this way we will gain a more efficient view against the monitoring stack.

Related reference(s)

Test coverage

Edited by Bogdan Antohe

Merge request reports