<p>I tried creating persistent volume using the host path. I can bind it to a specific node using node affinity but I didn't provide that. My persistent volume  YAML looks like this</p>

<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: jenkins
  labels:
    type: fast
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Recycle
  hostPath:
    path: /mnt/data
</code></pre>

<p>After this I created  PVC</p>

<pre><code>---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: myclaim
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 1Gi
</code></pre>

<p>And finally attached it onto the pod.</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
    - name: myfrontend
      image: thinkingmonster/nettools
      volumeMounts:
        - mountPath: "/var/www/html"
          name: mypd
  volumes:
    - name: mypd
      persistentVolumeClaim:
        claimName: myclaim
</code></pre>

<p>Now in describe command for pv or pvc it does not tell that on which node it has actually kept the volume /mnt/data</p>

<p>and I had to ssh to all nodes to locate the same.</p>

<p>And pod is smart enough to be created on that node only where Kubernetes had mapped host directory to PV</p>

<p>How can I know that on which node Kubernetes has created Persistent volume? Without the requirement to ssh the nodes or check  that where is pod running.</p>

thinkingmonster
<p>It's only when a volume is bound to a claim that it's associated with a particular node. HostPath volumes are a bit different than the regular sort, making it a little less clear. When you <code>get</code> the volume claim, the annotations on it should give you a bunch of information, including what you're looking for. In particular, look for the:</p>

<pre><code>volume.kubernetes.io/selected-node: ${NODE_NAME}
</code></pre>

<p>annotation on the PVC. You can see the annotations, along with the other computed configuration, by asking the Kubernetes api server for that info:</p>

<pre><code>kubectl get pvc -o yaml -n ${NAMESPACE} ${PVC_NAME}
</code></pre>
