Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

[Alert manager] Add firing status to the cert expiration checker alert #5440

Merged
merged 2 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/manual/cluster-admin/how-to-use-alert-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down