How to create alert on pod in Automation Suite?
Follow the 4 steps below to create alert on pod in Automation Suite (take the rook-ceph-rgw pod for example).
- Create a
PrometheusRuleyaml file with the content below:
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: rook-ceph-rgw-alerts
namespace: cattle-monitoring-system
labels:
release: cattle-monitoring-system
spec:
groups:
- name: rook-ceph-rgw.rules
rules:
- alert: RookCephRGWPodNotReady
expr: |
sum(
kube_pod_status_ready{
condition="true",
namespace="rook-ceph",
pod=~"rook-ceph-rgw-.*"
}
) < 1
for: 5m
labels:
severity: critical
team: storage
component: rook-ceph-rgw
annotations:
summary: "Rook-Ceph RGW pods are not ready"
description: |
All RGW pods in namespace 'rook-ceph' are not ready
(ready count < 1 for more than 5 minutes).
Check the rook-ceph rgw deployment/statefulset, Ceph cluster health,
and NFS / object gateway endpoints.
- Execute command
kubectl apply -f PrometheusRule.yamlto created defined Prometheus rule - Execute command
kubectl get PrometheusRule -A | grep rook-ceph-rgw-alertsto verify if the rule is created - Once the issue happens, check if related alert got generated in Prometheus monitoring tool.