Simple Log Service provides built-in alert rule templates. If you want to monitor a Kubernetes cluster in real time, you need to only create an alert rule from a template. Then, you can receive alert notifications such as DingTalk messages. This topic describes how to create alert rules.
Prerequisites
An event center is created in K8s Event Center, and Kubernetes cluster events are collected to the event center. For more information, see Create and use an event center.
Background information
K8s Event Center provides the following built-in resources: alert rule templates, Container Service for Kubernetes (ACK) action policy, ACK user group, ACK-pod alert template, ACK alert template, ACK-node alert template, and ACK-object alert template. The built-in resources can meet the requirements of most alerting scenarios. Before you use the built-in resources, take note of the following items:
You can specify the ACK action policy in an alert rule template.
You can specify the ACK user group and an alert template in the ACK action policy. The alert template can be an ACK-pod alert template, ACK alert template, ACK-node alert template, or ACK-object alert template.
After an alert is triggered, Simple Log Service sends an alert notification to the specified users based on the action policy.
Step 1: Create a user
Log on to the Simple Log Service console.
In the Log Application section, click the Intelligent O&M tab. Then, click K8s Event Center.
In the left-side navigation pane, click the icon next to the event center and click Alert Configuration.
On the Alert Center page, choose .
Create a user.
For more information, see Create users.
Step 2: Add the user to the ACK user group
On the Alert Center page, choose .
In the list of user groups, find sls.app.ack.builtin and click Edit in the Actions column.
In the Edit User Group dialog box, add the created user from the Available Members section to the Selected Members section and click OK.
Step 3: Create an alert rule
Simple Log Service provides dozens of built-in alert rule templates for K8s Event Center. You need to only select a template based on your business requirements and create an alert rule. In the following example, the Cluster Node Ready alert rule template is used.
On the Alert Center page, click the icon to the right of
.Click Create from Template.
In the Create from Template panel, click SLS K8s Event Center.
In the list of alert rule templates, click the alert rule template that you want to use.
In the Create Alert panel, specify the ID of your cluster for
cluster_id
. For more information about how to create an alert rule, see Create an alert rule.
What to do next
After you create an alert rule for an event center, you can perform the following operations.
Operation | Description |
Disable an alert rule | If you disable an alert rule, the value in the Status column of the alert rule changes to Disabled, and alerts are no longer triggered based on the alert rule. The configurations of the alert rule are not deleted. If you want to enable the alert rule again, you do not need to reconfigure the parameters of the alert rule. |
Pause an alert rule | If you pause an alert rule, alerts are not triggered based on the alert rule within a specified period of time. |
Delete an alert rule | The configurations of the alert rule are deleted. If you want to enable the alert rule again, you must reconfigure the parameters of the alert rule. |
Reconfigure an alert rule | You can reconfigure the parameters of an alert rule. |
View | You can view the general information of an alert rule and the historical alerts that are triggered based on the alert rule. |
Follow | You can add an alert rule to the list that you follow. |
Create a custom alert rule | If built-in alert rule templates do not meet your business requirements, you can click Create Alert to create a custom alert rule. For more information, see Create an alert rule. |