<p>I am trying to create a Kubernetes pod and mounting a volume from local hostpath. I am using Azure Kubernetes cluster. Following is my yaml for creating pod</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: test-pd
spec:
  containers:
  - name: nginx
    image: nginx:1.7.9
    ports:
    - containerPort: 80
    volumeMounts:
    - mountPath: /opt/myfolder
      name: test-volume
  volumes:
  - name: test-volume
    hostPath:
      # directory location on host
      path: /Users/kkadam/minikube/myfolder
      # this field is optional
</code></pre>

<p>I have few files under <code>myfolder</code> which I want to use inside container. Files are present in local volume but not inside container.</p>

<p>What could be an issue?</p>

<p>You can not add local path to container running on AKS. You have to add the file on specific node where POD is scheduled.</p>

<p>If both are on same node POD and files then you can mount the files as  the volume to the container and use it.</p>

<p>However if your POD is schedule to another node then you will not be able to access the files inside the container.</p>

<p>If due to any reason your node restarted or deleted during auto-scaling you might lose the data.</p>
