From 5cc3124836c61e84ec0a4595835b92a766810328 Mon Sep 17 00:00:00 2001 From: Laszlo Uveges Date: Wed, 26 Jun 2024 09:41:19 +0200 Subject: [PATCH] Move zot alerting rules to be CAPI only (#1270) --- .../honeybadger/alerting-rules/zot.rules.yml | 2 + .../alerting-rules/zot.rules.test.yml | 0 .../alerting-rules/zot.rules.test.yml | 54 +++++++++++++++++++ .../alerting-rules/zot.rules.test.yml | 54 +++++++++++++++++++ 4 files changed, 110 insertions(+) rename test/tests/providers/{global => capi/capa-mimir}/platform/honeybadger/alerting-rules/zot.rules.test.yml (100%) create mode 100644 test/tests/providers/capi/capa/platform/honeybadger/alerting-rules/zot.rules.test.yml create mode 100644 test/tests/providers/capi/capz/platform/honeybadger/alerting-rules/zot.rules.test.yml diff --git a/helm/prometheus-rules/templates/platform/honeybadger/alerting-rules/zot.rules.yml b/helm/prometheus-rules/templates/platform/honeybadger/alerting-rules/zot.rules.yml index b65b299a1..0108d7ddd 100644 --- a/helm/prometheus-rules/templates/platform/honeybadger/alerting-rules/zot.rules.yml +++ b/helm/prometheus-rules/templates/platform/honeybadger/alerting-rules/zot.rules.yml @@ -1,3 +1,4 @@ +{{- if eq .Values.managementCluster.provider.flavor "capi" }} apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: @@ -46,3 +47,4 @@ spec: severity: page team: honeybadger topic: managementcluster +{{- end }} diff --git a/test/tests/providers/global/platform/honeybadger/alerting-rules/zot.rules.test.yml b/test/tests/providers/capi/capa-mimir/platform/honeybadger/alerting-rules/zot.rules.test.yml similarity index 100% rename from test/tests/providers/global/platform/honeybadger/alerting-rules/zot.rules.test.yml rename to test/tests/providers/capi/capa-mimir/platform/honeybadger/alerting-rules/zot.rules.test.yml diff --git a/test/tests/providers/capi/capa/platform/honeybadger/alerting-rules/zot.rules.test.yml b/test/tests/providers/capi/capa/platform/honeybadger/alerting-rules/zot.rules.test.yml new file mode 100644 index 000000000..6b130ff88 --- /dev/null +++ b/test/tests/providers/capi/capa/platform/honeybadger/alerting-rules/zot.rules.test.yml @@ -0,0 +1,54 @@ +--- +rule_files: + - zot.rules.yml + +tests: + - interval: 1m + input_series: + - series: 'kube_deployment_status_replicas_unavailable{cluster_type="management_cluster",namespace="zot",deployment="zot-zot"}' + values: '_x5 0x10 1x45' + alert_rule_test: + - alertname: ZotDeploymentNotSatisfied + eval_time: 46m + exp_alerts: + - exp_labels: + alertname: "ZotDeploymentNotSatisfied" + area: "platform" + cancel_if_cluster_status_creating: "true" + cancel_if_cluster_status_deleting: "true" + cancel_if_cluster_status_updating: "true" + cancel_if_outside_working_hours: "true" + cluster_type: "management_cluster" + deployment: "zot-zot" + namespace: "zot" + severity: "page" + team: "honeybadger" + topic: "managementcluster" + exp_annotations: + description: "Zot deployment zot/zot-zot is not satisfied." + opsrecipe: "zot/" + - interval: 1m + input_series: + - series: 'kubelet_volume_stats_available_bytes{namespace="zot", persistentvolumeclaim="zot-zot-pvc"}' + values: '50x30 20x30 15x30 5x60' + - series: 'kubelet_volume_stats_capacity_bytes{namespace="zot", persistentvolumeclaim="zot-zot-pvc"}' + values: '100x150' + alert_rule_test: + - alertname: ZotPersistentVolumeFillingUp + eval_time: 150m + exp_alerts: + - exp_labels: + alertname: "ZotPersistentVolumeFillingUp" + area: "platform" + cancel_if_cluster_status_creating: "true" + cancel_if_cluster_status_deleting: "true" + cancel_if_cluster_status_updating: "true" + cancel_if_outside_working_hours: "true" + namespace: "zot" + persistentvolumeclaim: "zot-zot-pvc" + severity: "page" + team: "honeybadger" + topic: "managementcluster" + exp_annotations: + description: "The Zot PersistentVolume claimed by zot-zot-pvc in namespace zot is at least 80% full and projected to fill up soon." + opsrecipe: "zot/" diff --git a/test/tests/providers/capi/capz/platform/honeybadger/alerting-rules/zot.rules.test.yml b/test/tests/providers/capi/capz/platform/honeybadger/alerting-rules/zot.rules.test.yml new file mode 100644 index 000000000..6b130ff88 --- /dev/null +++ b/test/tests/providers/capi/capz/platform/honeybadger/alerting-rules/zot.rules.test.yml @@ -0,0 +1,54 @@ +--- +rule_files: + - zot.rules.yml + +tests: + - interval: 1m + input_series: + - series: 'kube_deployment_status_replicas_unavailable{cluster_type="management_cluster",namespace="zot",deployment="zot-zot"}' + values: '_x5 0x10 1x45' + alert_rule_test: + - alertname: ZotDeploymentNotSatisfied + eval_time: 46m + exp_alerts: + - exp_labels: + alertname: "ZotDeploymentNotSatisfied" + area: "platform" + cancel_if_cluster_status_creating: "true" + cancel_if_cluster_status_deleting: "true" + cancel_if_cluster_status_updating: "true" + cancel_if_outside_working_hours: "true" + cluster_type: "management_cluster" + deployment: "zot-zot" + namespace: "zot" + severity: "page" + team: "honeybadger" + topic: "managementcluster" + exp_annotations: + description: "Zot deployment zot/zot-zot is not satisfied." + opsrecipe: "zot/" + - interval: 1m + input_series: + - series: 'kubelet_volume_stats_available_bytes{namespace="zot", persistentvolumeclaim="zot-zot-pvc"}' + values: '50x30 20x30 15x30 5x60' + - series: 'kubelet_volume_stats_capacity_bytes{namespace="zot", persistentvolumeclaim="zot-zot-pvc"}' + values: '100x150' + alert_rule_test: + - alertname: ZotPersistentVolumeFillingUp + eval_time: 150m + exp_alerts: + - exp_labels: + alertname: "ZotPersistentVolumeFillingUp" + area: "platform" + cancel_if_cluster_status_creating: "true" + cancel_if_cluster_status_deleting: "true" + cancel_if_cluster_status_updating: "true" + cancel_if_outside_working_hours: "true" + namespace: "zot" + persistentvolumeclaim: "zot-zot-pvc" + severity: "page" + team: "honeybadger" + topic: "managementcluster" + exp_annotations: + description: "The Zot PersistentVolume claimed by zot-zot-pvc in namespace zot is at least 80% full and projected to fill up soon." + opsrecipe: "zot/"