1
votes

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

1
have you checked pv details? - Lei Yang
I did run kubectl describe on both PV & PVC but they do not contain Node name. - Gopinath Rajee
if you describe pod, you should see both node info and pvc info. - Lei Yang
nodes are not necessarily associated with PV/PVC - wineinlib

1 Answers

3
votes
  • 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'