Persistent Volume claim is a request made for persistent volume. It consumes the storage provided by persistent volume. It can request specific storage size and access modes (such as ReadWriteOnce, ReadOnlyMany etc).
Kubernetes find the best persistent volume available matching the claim requirements such as requested storage, access modes etc.
Tip
Claim can also have label matchers to select particular volumes.
Assumption is if persistent volume is implemented using hostPath.
Pods using same pvc, get same location mounted on node if they run on same node. For above pvc, /shared will be mounted to some path such as /tmp/hostpath-provisioner/learning/mypvc where hostpath-provisioner is the provisioner, learning is namespace and mypvc is pvc name.
Pods using same pvc but on different nodes, they get same mounted path but on their respective nodes. For example, Pod1 runs on nodeB will get /tmp/hostpath-provisioner/learning/mypvc mounted path on nodeB. Pod2 runs on nodeC will get /tmp/hostpath-provisioner/learning/mypvc mounted path on nodeC.
Pods using different pvc get different mount paths on nodes irrespective if they run on same node or different nodes.