Prometheus Installed Using Helm Not Alerting PersistsentVolumeClaim Full Alerts.

Problem

Alerts are not fired in Prometheus when PersistsentVolumeClaims are filled or exceeded the volume limits set for alerts.

Environment

  • Platform9 Managed Kubernetes - v5.5 and Higher

Cause

The query used in the upstream prometheus rule to trigger the KubePersistentVolumeFillingUp is giving Empty query result.

(kubelet_volume_stats_available_bytes{job="kubelet",namespace=~".*"} / kubelet_volume_stats_capacity_bytes{job="kubelet",namespace=~".*"}) < 0.15 and kubelet_volume_stats_used_bytes{job="kubelet",namespace=~".*"} > 0 and predict_linear(kubelet_volume_stats_available_bytes{job="kubelet",namespace=~".*"}[6h], 4 * 24 * 3600) > 0 unless on(namespace, persistentvolumeclaim) kube_persistentvolumeclaim_access_mode{access_mode="ReadOnlyMany"} == 1 unless on(namespace, persistentvolumeclaim) kube_persistentvolumeclaim_labels{label_excluded_from_alerts="true"} == 1

Rules used in the prometheusrule kubernetes object:

Resolution

This issue is resolved in PMK-5.9 release- Tracked in the internal jira: PMK-5701

Workaround

Modify the query compatible with the Platform9 Managed Kubernetes environment as shown below in the prometheusrule kubernetes object.

Once you are getting the right result for the query, you can edit the existing prometheus rules with working query using the kubectl command:

Once edited prometheus should automatically detect the change in rule and fire the alerts if PVCs have exceeded the space limits.

Additional Information

The workaround suggested will not persist across upgrades unless changes made in the helm chart.

Last updated