From f56ae3e0e4ff81e24dd392dab5e76859afb49329 Mon Sep 17 00:00:00 2001 From: Felix Krohn Date: Thu, 15 Jun 2023 09:15:01 +0200 Subject: [PATCH] Update rules.yaml on OCP clusters where the cluster monitoring operator is used (as advised in README) instead of the user-workload-monitoring stack, the `namespace` in the metrics is always the one of the cert-utils-operator. The namespace of the secret/certificate gets rewritten to exported_namespace by default. Not 100% sure if this is the correct place to fix this though? --- config/prometheus/rules.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/prometheus/rules.yaml b/config/prometheus/rules.yaml index be1bc37..a6087d4 100644 --- a/config/prometheus/rules.yaml +++ b/config/prometheus/rules.yaml @@ -15,9 +15,9 @@ spec: - alert: CertificateApproachingExpiration annotations: message: >- - Certificate {{ $labels.namespace }}/{{ $labels.name }} is at 85% of its lifetime + Certificate {{ $labels.exported_namespace }}/{{ $labels.name }} is at 85% of its lifetime summary: >- - Certificate {{ $labels.namespace }}/{{ $labels.name }} is at 85% of its lifetime + Certificate {{ $labels.exported_namespace }}/{{ $labels.name }} is at 85% of its lifetime expr: | cert:time_to_expiration:sec/cert:validity_duration:sec < 0.15 labels: @@ -25,10 +25,10 @@ spec: - alert: CertificateIsAboutToExpire annotations: message: >- - Certificate {{ $labels.namespace }}/{{ $labels.name }} is at 95% of its lifetime + Certificate {{ $labels.exported_namespace }}/{{ $labels.name }} is at 95% of its lifetime summary: >- - Certificate {{ $labels.namespace }}/{{ $labels.name }} is at 95% of its lifetime + Certificate {{ $labels.exported_namespace }}/{{ $labels.name }} is at 95% of its lifetime expr: > cert:time_to_expiration:sec/cert:validity_duration:sec < 0.05 labels: - severity: critical \ No newline at end of file + severity: critical