<p>Does windows minikube support a persistent volume with a hostpath? If so what is the syntax?</p>

<p>I tried:</p>

<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: kbmongo002
  labels:
    type: local
spec:
  storageClassName: mongostorageclass
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/temp/mongo"
    persistentVolumeReclaimPolicy: Retain
---
</code></pre>

<p>This passed validation and created the PV and a PVC claimed it, but nothing was written to my expected location of C:\temp\mongo</p>

<p>I also tried:</p>

<pre><code>  hostPath:
    path: "c:/temp/mongo"
    persistentVolumeReclaimPolicy: Retain
---
</code></pre>

<p>That resulted in:</p>

<pre><code>Error: Error response from daemon: Invalid bind mount spec 
"c:/temp/mongo:/data/db": invalid mode: /data/db 
Error syncing pod 
</code></pre>

<p>If you use virtualbox in windows, only the <code>c:/Users</code> is mapped into vm as <code>/c/Users</code> which is kubernetes system can access. It is the feature in Virtualbox.</p>

<p><a href="https://i.stack.imgur.com/6TWOC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6TWOC.png" alt="snapshot"></a></p>

<p>Minikube use VM to simulate the kubernetes VM.</p>

<p>Minikube provides mount feature as well, not so user-friendly for persitency.</p>

<p>You can try choose one of the solutions below</p>

<ul>
<li>use folders under <code>/c/Users</code> for your yaml file</li>
<li>map extra folders into virtualbox VM like <code>C:\Users</code></li>
<li>use <code>minikube mount</code>, see <a href="https://github.com/kubernetes/minikube/blob/master/docs/host_folder_mount.md" rel="nofollow noreferrer">host folder mount</a></li>
</ul>
