KubernetesPersistentvolumeclaimPending #
PersistentVolumeClaim {{ $labels.namespace }}/{{ $labels.persistentvolumeclaim }} is pending
Alert Rule
alert: KubernetesPersistentvolumeclaimPending
annotations:
description: |-
PersistentVolumeClaim {{ $labels.namespace }}/{{ $labels.persistentvolumeclaim }} is pending
VALUE = {{ $value }}
LABELS = {{ $labels }}
runbook: https://srerun.github.io/prometheus-alerts/runbooks/kubestate-exporter/kubernetespersistentvolumeclaimpending/
summary: Kubernetes PersistentVolumeClaim pending ({{ $labels.namespace }}/{{ $labels.persistentvolumeclaim
}})
expr: kube_persistentvolumeclaim_status_phase{phase="Pending"} == 1
for: 2m
labels:
severity: warning
Here is a sample runbook for the KubernetesPersistentvolumeclaimPending alert:
Meaning #
The KubernetesPersistentvolumeclaimPending alert is triggered when a Persistent Volume Claim (PVC) in a Kubernetes cluster is in a pending state. This means that the PVC has been created and is waiting for a matching Persistent Volume (PV) to be provisioned and bound to it. This alert is warning-level, indicating that the issue needs to be addressed to ensure normal operation of the application.
Impact #
If a PVC remains in a pending state for an extended period, it can cause several issues:
- Applications that rely on the PVC may not function correctly or may experience errors.
- The cluster’s storage capacity may be unavailable, leading to performance issues or even outages.
- Other PVCs or Pods may be blocked from using the same storage resources, causing a ripple effect in the cluster.
Diagnosis #
To diagnose the issue, follow these steps:
- Check the PVC’s status using
kubectl describe pvc <pvc-name> -n <namespace>
. - Verify that the PVC’s storage class and access mode match the available PVs in the cluster.
- Check the cluster’s storage capacity and available resources using
kubectl get pv -o wide
. - Review the cluster’s events and logs to identify any errors or issues related to the PVC or PV provisioning.
Mitigation #
To mitigate the issue, follow these steps:
- Verify that the cluster has sufficient storage capacity and available resources.
- Check if there are any issues with the storage class or access mode configuration.
- If necessary, create a new PV that matches the PVC’s requirements.
- Bind the PV to the PVC using
kubectl patch pvc <pvc-name> -n <namespace> -p '{"spec":{"volumeName":"<pv-name>"}}'
. - Verify that the PVC is now in a bound state using
kubectl get pvc <pvc-name> -n <namespace>
.
Additional resources:
- Kubernetes documentation: Persistent Volumes
- Kubernetes documentation: Persistent Volume Claims