From 3c5e425e42e738df5640552b11b3101c60909d8e Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Fri, 23 Apr 2021 16:29:20 +0800 Subject: [PATCH 1/2] Add firing status to the cert expiration checker alert --- src/alert-manager/src/cert-expiration-checker/send_alert.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/alert-manager/src/cert-expiration-checker/send_alert.py b/src/alert-manager/src/cert-expiration-checker/send_alert.py index 355ee2e133..5a833823c5 100644 --- a/src/alert-manager/src/cert-expiration-checker/send_alert.py +++ b/src/alert-manager/src/cert-expiration-checker/send_alert.py @@ -30,6 +30,7 @@ def send_alert(pai_url: str, residualTime: int, certExpirationInfo: str): post_url = pai_url.rstrip("/") + ALERT_PREFIX alerts = [] alert = { + "status": "firing", "labels": { "alertname": "k8s cert expiration", "severity": "fatal", From e9a26e6b387c2a046438928479e74eace3d5342e Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Fri, 23 Apr 2021 16:51:00 +0800 Subject: [PATCH 2/2] update docs --- docs/manual/cluster-admin/how-to-use-alert-system.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/manual/cluster-admin/how-to-use-alert-system.md b/docs/manual/cluster-admin/how-to-use-alert-system.md index 1a3057a656..d39c851834 100644 --- a/docs/manual/cluster-admin/how-to-use-alert-system.md +++ b/docs/manual/cluster-admin/how-to-use-alert-system.md @@ -287,12 +287,11 @@ To make your configuration take effect, restart the `alert-manager` service afte We provide the functionality to check the k8s cert expiration date and send warning to admin users. -This feature will be enable by default, if the action `email-admin` is enabled. You can configure the `alert-manager`->`cert-expiration-checker` field in `services-configuration.yml`. `schedule`, `alert-residual-days` and `cert-path` are necessary fields for this feature, and we have default value for the fields. For the syntax of `schedule`, please refer to [Cron Schedule Syntax](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax). For example, `"0 0 * * *"` means daily report at UTC 00:00. -Please also make sure that the [`email-admin`](#Existing-Actions-and-Matching-Rules) action is enabled. +An alert will be send to the admin, if [`email-admin`](#Existing-Actions-and-Matching-Rules) action is enabled. ```yaml alert-manager: