How to Proactively Monitor PLEG Health with Prometheus and Alertmanager Rules
Problem
The Pod Lifecycle Event Generator (PLEG) (introduced in Kubernetes 1.2) – a component which detects changes in container states locally – needs to remain in a "Healthy" state; it is imperative to proactively monitor vitals or metrics related to its health as it relates to the state of the node (which will transition into a "NotReady" state shall PLEG be deemed "Unhealthy" which will cease scheduling).
Environment
Platform9 Managed Kubernetes – v5.4 and Higher
Prometheus Monitoring
Kubelet
Procedure
If Prometheus Monitoring is not already enabled (it should be enabled by default, but, for older clusters this may not apply), follow the instructions in Enable In-Cluster Monitoring.
Export Kubeconfig.
export KUBECONFIG=~/<cluster-name>.yamlList the
PrometheusRulesin thepf9-monitoringnamespace.
$ kubectl -n pf9-monitoring get prometheusrules.monitoring.coreos.com
NAME AGE
system-prometheus-rules 22mEdit the
system-prometheus-rulesobject and add the following rules.
Access the Prometheus UI via Qbert API proxy (similar to Grafana) or via
kubectl port-forwardassociated with theprometheus-operatedservice exposed on TCP/9090.Navigate to the Alerts tab.
Search for and/or verify from the list of alarms that the
KubeletPlegDurationHighalarm has been added and is showing green.

Last updated
