<p>I want to define pvc and create volume in order to get some internal files from container outside (I am using helm charts definitions). I want to know is there any way to use POD IP in mountPath that I am defining in deployment.yaml.</p>

<p>At the end I want to get folder structure in my node
/dockerdata-nfs//path</p>

<pre><code>volumeMounts:
     - name: volumeName
       mountPath: /abc/path

volumes:
    - name: volumeName
      hostPath:
        path: /dockerdata-nfs/podID/
</code></pre>

liotur
<p>You can create a mountPath based on the POD UID using the <code>subPathExpr</code>. Yaml below:
<code>
apiVersion: v1
kind: Pod
metadata:
  name: pod1
spec:
  containers:
  - name: container1
    env:
    - name: UID
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: metadata.uid
    image: busybox
    volumeMounts:
    - name: workdir1
      mountPath: /logs
      subPathExpr: $(UID)
  volumes:
  - name: workdir1
    hostPath:
      path: /var/log/pods
</code>
This feature was introduced in Kubernetes version 1.14+.</p>
