Repository navigation
Restore custom KubeVirt PrometheusRule alerts loader #2503
Description
What happened
After #2502 (KubeVirt operator update to v1.8.2), the cozystack-specific PrometheusRule alerts are no longer rendered.
packages/system/kubevirt-operator/templates/alerts.yaml was the glob loader:
{{ $files := .Files.Glob "alerts/*.yaml" }}
{{ range $path, $bytes := $files }}
...It was removed in #2502. The data file packages/system/kubevirt-operator/alerts/PrometheusRule.yaml is still in the tree but no template references it now.
What's lost
Two alerts maintained in this repo across multiple commits:
VMNotRunningFor10MinutesVMINotRunningFor10Minutes
Verified via helm template packages/system/kubevirt-operator:
main(before chore(kubevirt-operator): update to v1.8.2 #2502): renders 1PrometheusRule- after chore(kubevirt-operator): update to v1.8.2 #2502: renders 0
PrometheusRule
The upstream operator does not generate equivalents — checked pkg/monitoring/rules/alerts/vms.go at v1.8.2; the rules package emits VirtLauncherPodsStuckFailed, OrphanedVirtualMachineInstances, etc., but neither of the two cozystack alerts.
Suggested fix
Either:
- Restore
templates/alerts.yaml(the 7-line glob loader). Smallest possible change. - Move
alerts/PrometheusRule.yamldirectly undertemplates/so it renders without a glob loader, andgit rmthe emptyalerts/directory.
If dropping the alerts is intentional (e.g., they were considered noisy), please close this with a note and git rm the orphaned alerts/PrometheusRule.yaml so the repo stays consistent.
Note
ServiceMonitor removal in the same PR is fine — the operator creates an equivalent in tenant-root because the cozystack KubeVirt CR sets monitorNamespace: tenant-root.
Activity
dosubot commentedon Jul 27, 2026
Hi, Aleksei Sviridkin (@lexfrei). I'm Dosu, and I'm helping the cozystack team manage their backlog and am marking this issue as stale.
Recap
alerts/*.yamlappears to have been removed.VMNotRunningFor10MinutesandVMINotRunningFor10Minutesare no longer generated.alerts/PrometheusRule.yamlis rendered unless these alerts are intentionally being dropped.Next Steps
Thanks for your understanding and contribution.
lexfrei commentedon Sep 2, 2026
Fixed by 7106f07: the PrometheusRule is a Helm-rendered template now, packages/system/kubevirt-operator/templates/prometheusrule.yaml renders both VMNotRunningFor10Minutes and VMINotRunningFor10Minutes, and the alerts/ directory is gone. Closing.