diff --git a/charts/cluster/templates/prometheus-rule.yaml b/charts/cluster/templates/prometheus-rule.yaml index fc3f35cb4d..2af43498c2 100644 --- a/charts/cluster/templates/prometheus-rule.yaml +++ b/charts/cluster/templates/prometheus-rule.yaml @@ -17,7 +17,7 @@ spec: {{- $_ := set $dict "namespace" (include "cluster.namespace" .) -}} {{- $_ := set $dict "cluster" (include "cluster.fullname" .) -}} {{- $_ := set $dict "labels" (dict "job" "{{ $labels.job }}" "node" "{{ $labels.node }}" "pod" "{{ $labels.pod }}") -}} - {{- $_ := set $dict "podSelector" (printf "%s-([1-9][0-9]*)$" (include "cluster.fullname" .)) -}} + {{- $_ := set $dict "podSelector" (printf "%s-([1-9][0-9]*)" (include "cluster.fullname" .)) -}} {{- $_ := set $dict "Values" .Values -}} {{- $_ := set $dict "Template" .Template -}} {{- range $path, $_ := .Files.Glob "prometheus_rules/**.yaml" }} diff --git a/charts/cluster/test/monitoring/01-monitoring_cluster-assert.yaml b/charts/cluster/test/monitoring/01-monitoring_cluster-assert.yaml index ff2d676bcc..d5b561af79 100644 --- a/charts/cluster/test/monitoring/01-monitoring_cluster-assert.yaml +++ b/charts/cluster/test/monitoring/01-monitoring_cluster-assert.yaml @@ -120,6 +120,13 @@ spec: labels: environment: staging oncall: "false" + # the low disk space alerts must also match the WAL and tablespace PVCs + (rules[?alert == 'CNPGClusterLowDiskSpaceCritical'] | [0]): + (contains(expr, 'persistentvolumeclaim=~"monitoring-cluster-([1-9][0-9]*)-wal"')): true + (contains(expr, 'persistentvolumeclaim=~"monitoring-cluster-([1-9][0-9]*)-tbs.*"')): true + (rules[?alert == 'CNPGClusterLowDiskSpaceWarning'] | [0]): + (contains(expr, 'persistentvolumeclaim=~"monitoring-cluster-([1-9][0-9]*)-wal"')): true + (contains(expr, 'persistentvolumeclaim=~"monitoring-cluster-([1-9][0-9]*)-tbs.*"')): true --- apiVersion: v1 kind: ConfigMap