get_pvc_summaries
List PersistentVolumeClaim summaries for a namespace or all namespaces and identify which pods mount each claim, helping detect orphaned or unmounted PVCs.
Instructions
Retrieves a list of PVCSummary objects for PersistentVolumeClaims in a given
namespace or all namespaces, similar to kubectl get pvc.
For each PVC, this also resolves which pods currently mount it (by scanning pod
volumes in the same scope), which is useful for spotting orphaned PVCs — claims
with an empty `mounted_by` and no owning pod.
Parameters
----------
namespace : Optional[str], default=None
The specific namespace to list PVCs from. If None, lists from all namespaces.
Returns
-------
list of PVCSummary
A list of PVCSummary objects, each with the following fields:
name : str
Name of the PVC.
namespace : str
Namespace of the PVC.
status : str
Phase of the PVC ("Bound", "Pending", or "Lost").
volume_name : Optional[str]
Name of the bound PersistentVolume (None if unbound).
capacity : Optional[str]
Storage capacity (e.g. "10Gi"); falls back to the requested size when
the claim is not yet bound.
access_modes : list[str]
Access modes (e.g. ["ReadWriteOnce"]).
storage_class : Optional[str]
StorageClass backing the claim.
mounted_by : list[str]
Names of pods (in the same scope) currently mounting this PVC. Empty
for orphaned/unmounted claims.
age : datetime.timedelta
Age of the PVC (current time minus creation timestamp).
Raises
------
K8sConfigError
If unable to initialize the K8S API.
K8sApiError
If the API call to list PVCs fails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |