How to Create Alert on Pod in Automation Suite

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).

  1. Create a PrometheusRule yaml 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.

  1. Execute command kubectl apply -f PrometheusRule.yaml to created defined Prometheus rule
  2. Execute command kubectl get PrometheusRule -A | grep rook-ceph-rgw-alerts to verify if the rule is created
  3. Once the issue happens, check if related alert got generated in Prometheus monitoring tool.