Identify nodes of Persistent Volume Claims

7/14/2021

All,

Is there a way to find the nodes associated with Persistent Volume Claim.

> kubectl get pvc -n namespace

gives me the list of Persistent Volume Claims. But I need the node also to which each of the Claim is associated with.

Even describing the PVC does not give me the node

kubectl describe pvc pvcname -n namespace

Thanks,
grajee

-- Gopinath Rajee
azure-aks
kubernetes
persistent-volume-claims

1 Answer

7/14/2021
  • whenever PVC is used by a POD , kubernetes creates a object called volumeattachment which contains the node information where the pvc is attached.
   - kubectl get volumeattachements | grep <pv name> // to get the volumeattachment name
   - kubectl describe volumeattachment <volumeattachment name from above command> | grep -i 'node name'
-- confused genius
Source: StackOverflow