<p>I have tried desperately to apply a simple pod specification without any luck, even with this previous answer: <a href="https://stackoverflow.com/questions/48534980/mount-local-directory-into-pod-in-minikube">Mount local directory into pod in minikube</a></p>
<p>The yaml file:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
  name: hostpath-pod
spec:
  containers:
    - image: httpd
      name: hostpath-pod
      volumeMounts:
        - mountPath: /data
          name: test-volume
  volumes:
    - name: test-volume
      hostPath:
        # directory location on host
        path: /tmp/data/
</code></pre>
<p>I started minikube cluster with: <code>minikube start --mount-string=&quot;/tmp:/tmp&quot; --mount</code> and there are 3 files in <code>/tmp/data</code>:</p>
<pre class="lang-sh prettyprint-override"><code>ls /tmp/data/
file2.txt file3.txt hello
</code></pre>
<p>However, this is what I get when I do <code>kubectl describe pods</code>:</p>
<pre><code>Events:
  Type     Reason     Age                  From               Message
  ----     ------     ----                 ----               -------
  Normal   Scheduled  2m26s                default-scheduler  Successfully assigned default/hostpath-pod to minikube
  Normal   Pulled     113s                 kubelet, minikube  Successfully pulled image &quot;httpd&quot; in 32.404370125s
  Normal   Pulled     108s                 kubelet, minikube  Successfully pulled image &quot;httpd&quot; in 3.99427232s
  Normal   Pulled     85s                  kubelet, minikube  Successfully pulled image &quot;httpd&quot; in 3.906807762s
  Normal   Pulling    58s (x4 over 2m25s)  kubelet, minikube  Pulling image &quot;httpd&quot;
  Normal   Created    54s (x4 over 112s)   kubelet, minikube  Created container hostpath-pod
  Normal   Pulled     54s                  kubelet, minikube  Successfully pulled image &quot;httpd&quot; in 4.364295872s
  Warning  Failed     53s (x4 over 112s)   kubelet, minikube  Error: failed to start container &quot;hostpath-pod&quot;: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting &quot;/tmp/data&quot; to rootfs at &quot;/data&quot; caused: stat /tmp/data: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
  Warning  BackOff    14s (x6 over 103s)   kubelet, minikube  Back-off restarting failed container
</code></pre>
<p>Not sure what I'm doing wrong here. If it helps I'm using minikube version <code>v1.23.2</code> and this was the output when I started minikube:</p>
<pre><code>😄  minikube v1.23.2 on Darwin 11.5.2
    ▪ KUBECONFIG=/Users/sachinthaka/.kube/config-ds-dev:/Users/sachinthaka/.kube/config-ds-prod:/Users/sachinthaka/.kube/config-ds-dev-cn:/Users/sachinthaka/.kube/config-ds-prod-cn
✨  Using the hyperkit driver based on existing profile
👍  Starting control plane node minikube in cluster minikube
🔄  Restarting existing hyperkit VM for &quot;minikube&quot; ...
❗  This VM is having trouble accessing https://k8s.gcr.io
💡  To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
🐳  Preparing Kubernetes v1.22.2 on Docker 20.10.8 ...
🔎  Verifying Kubernetes components...
📁  Creating mount /tmp:/tmp ...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: storage-provisioner, default-storageclass

❗  /usr/local/bin/kubectl is version 1.18.0, which may have incompatibilites with Kubernetes 1.22.2.
    ▪ Want kubectl v1.22.2? Try 'minikube kubectl -- get pods -A'
🏄  Done! kubectl is now configured to use &quot;minikube&quot; cluster and &quot;default&quot; namespace by default
</code></pre>
<p>Anything I can try? :'(</p>
<h2>Update 1</h2>
<ul>
<li>Changing from <code>minikube</code> to <code>microk8s</code> helped. But I'm still not seeing anything inside <code>/data/</code> in the pod.</li>
<li>Also changing from <code>/tmp/</code> to a different folder helped in <code>minikube</code>. Something to do with MacOs.</li>
</ul>

sachinruk
<p><strong>OP has said, that problem is solved:</strong></p>
<blockquote>
<p>changing from /tmp/ to a different folder helped in minikube. Something to do with MacOs
For some reason minikube doesn't like <code>/tmp/</code></p>
</blockquote>
<p><strong>An explanation of this problem:</strong>
You cannot mount <code>/tmp</code> to <code>/tmp</code>. The problem isn't with macOS, but with the way you do it. I tried to recreate this problem in several ways. I used a docker and got a very interesting error:</p>
<pre><code>docker: Error response from daemon: Duplicate mount point: /tmp.
</code></pre>
<p>This error makes it clear what the problem is. If you mount your catalog elsewhere, everything should work (which was confirmed):</p>
<blockquote>
<p>Do I understand correctly, that when you changed the mount point to a different folder, does it work?</p>
</blockquote>
<blockquote>
<p>that is correct. For some reason minikube doesn't like <code>/tmp/</code></p>
</blockquote>
<p>I know you are using hyperkit instead of docker in my case, but the only difference will be in the message you get on the screen. In the case of the docker, it is very clear.</p>
