From 1df5d3559a5f8da896bf0dac28ed00695647f3a2 Mon Sep 17 00:00:00 2001 From: Vitaliy Chefanov Date: Wed, 23 Sep 2026 21:47:20 +0300 Subject: [PATCH] v0.7.1: render alert rules on DKP without operator-prometheus-crd helm_lib_prometheus_rules only renders when "operator-prometheus-crd" is an enabled module; on DKP 1.76 that module doesn't exist (the CRDs come with operator-prometheus), so the two alerts were silently dropped on a live install. Gate on the PrometheusRule API instead. Co-Authored-By: Claude Opus 5.5 --- Chart.yaml | 2 +- Makefile | 2 +- changelog.yaml | 3 +++ templates/monitoring.yaml | 8 +++++++- tests/values/default.yaml | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index eefc431..e29627f 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,5 +1,5 @@ name: cluster-map -version: 0.7.0 +version: 0.7.1 dependencies: - name: deckhouse_lib_helm version: 1.72.24 diff --git a/Makefile b/Makefile index bf1549b..37bf8ea 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ WERF ?= werf BUILD_REGISTRY ?= localhost:5555 BUILD_REPO ?= $(BUILD_REGISTRY)/$(MODULE) DMT ?= dmt -API_VERSIONS ?= --api-versions autoscaling.k8s.io/v1/VerticalPodAutoscaler --api-versions monitoring.coreos.com/v1/PodMonitor +API_VERSIONS ?= --api-versions autoscaling.k8s.io/v1/VerticalPodAutoscaler --api-versions monitoring.coreos.com/v1/PodMonitor --api-versions monitoring.coreos.com/v1/PrometheusRule .PHONY: test lint render base-images build-registry build publish release diff --git a/changelog.yaml b/changelog.yaml index 3d9e097..c5f3f91 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -1,3 +1,6 @@ +v0.7.1: + fixes: + - Alert rules are rendered on DKP versions without the operator-prometheus-crd module. v0.7.0: features: - First release as a Deckhouse module (ModuleSource, release channels, lib-helm templates). diff --git a/templates/monitoring.yaml b/templates/monitoring.yaml index 14e4453..f42057d 100644 --- a/templates/monitoring.yaml +++ b/templates/monitoring.yaml @@ -27,4 +27,10 @@ spec: regex: "true" action: keep {{- end }} -{{- include "helm_lib_prometheus_rules" (list . "d8-cluster-map") }} +{{- /* helm_lib_prometheus_rules only renders when "operator-prometheus-crd" + is among enabled modules; on DKP 1.76 the CRDs ship with + operator-prometheus and that module name no longer exists, so the + rules were silently dropped. Gate on the API itself instead. */}} +{{- if (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PrometheusRule") }} +{{- include "helm_lib_prometheus_rules_recursion" (list . "d8-cluster-map" "monitoring/prometheus-rules") }} +{{- end }} diff --git a/tests/values/default.yaml b/tests/values/default.yaml index 6f7bae6..9bf6a45 100644 --- a/tests/values/default.yaml +++ b/tests/values/default.yaml @@ -2,7 +2,7 @@ # CertManager https, cilium-hubble installed. Used by `make render`. global: clusterIsBootstrapped: true - enabledModules: ["user-authn", "cert-manager", "vertical-pod-autoscaler", "operator-prometheus-crd", "cilium-hubble"] + enabledModules: ["user-authn", "cert-manager", "vertical-pod-autoscaler", "operator-prometheus", "cilium-hubble"] discovery: clusterDomain: cluster.local clusterControlPlaneIsHighlyAvailable: false