<p>I have pod definition file</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: ubuntu-docker-soc
spec:
  containers:
  - name: ubuntu-docker-soc
    image: rajendarre/ubuntu-docker
    command: [ &quot;/bin/sh&quot;, &quot;-c&quot;, &quot;--&quot; ]
    args: [ &quot;while true; do sleep 30; done;&quot; ]
    volumeMounts:
    - name: dockersock
      mountPath: &quot;/var/run/docker.sock&quot;

  restartPolicy: Never
  volumes:
  - name: dockersock
    hostPath:
      path: /var/run/docker.sock
</code></pre>
<p>I have created pod successfully ,
but command <code>kubectl get pv</code> is not showing any volumes ,
as I have volume  dockersoc , it should come as volume .
please let me know understanding is correct ?</p>

Rajendar Talatam
<p>PersistentVolume is a <code>provisioned</code> cluster resource, where else local file or directory  that you mount from the underlying node directly in your pod is not a cluster resource that requires provisioning. Therefore in your example, <code>kubectl get pv</code> will not get you anything.</p>
<p>Here's a good <a href="https://medium.com/avmconsulting-blog/persistent-volumes-pv-and-claims-pvc-in-kubernetes-bd76923a61f6" rel="nofollow noreferrer">discussion</a> about PV/PVC on major cloud providers.</p>
