From 824789fdd45c691ef163ea1055f4f38a41201acf Mon Sep 17 00:00:00 2001 From: Jose Armesto Date: Wed, 27 Nov 2024 12:15:55 +0100 Subject: [PATCH] Add alert to monitor KubeadmConfig --- CHANGELOG.md | 4 +++ .../capi-kubeadmconfig.rules.yml | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 helm/prometheus-rules/templates/kaas/turtles/alerting-rules/capi-kubeadmconfig.rules.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 3731c848..7102d9cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Add alert to monitor the `KubeadmConfig` CRs having trouble generating bootstrap data. + ## [4.26.2] - 2024-11-27 ### Changed diff --git a/helm/prometheus-rules/templates/kaas/turtles/alerting-rules/capi-kubeadmconfig.rules.yml b/helm/prometheus-rules/templates/kaas/turtles/alerting-rules/capi-kubeadmconfig.rules.yml new file mode 100644 index 00000000..e3bf4d6d --- /dev/null +++ b/helm/prometheus-rules/templates/kaas/turtles/alerting-rules/capi-kubeadmconfig.rules.yml @@ -0,0 +1,26 @@ +{{- if eq .Values.managementCluster.provider.flavor "capi" }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + labels: {{- include "labels.common" . | nindent 4}} + name: capi-kubeadmconfig.rules + namespace: {{.Values.namespace}} +spec: + groups: + - name: capi-kubeadmconfig + rules: + - alert: KubeadmConfigDataSecretNotAvailable + expr: capi_kubeadmconfig_status_condition{type="DataSecretAvailable", status="False"} > 0 + for: 1h + labels: + area: kaas + cancel_if_monitoring_agent_down: "true" + cancel_if_outside_working_hours: "true" + severity: page + team: {{ include "providerTeam" . }} + topic: managementcluster + annotations: + description: |- + {{`KubeadmConfig {{$labels.exported_namespace}}/{{$labels.name}} in cluster {{$labels.cluster_name}} encountered errors while generating a data secret`}} + opsrecipe: capi-kubeadmconfig/ +{{- end }}