<p>I'm at the first steps with Kubernetes, and i'm stuck with a problem of Windows paths.
I defined a .yaml where for a PersistentVolume i have (file not complete, only the part for the problem)</p>

<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: mongo-pv
spec:
  capacity:
    storage: 1Gi
  volumeMode: Filesystem
  accessModes:
  - ReadWriteOnce
  storageClassName: local-storage
  local:
    path: /c/temp/data/db
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - docker-desktop
</code></pre>

<p>I'm using the latest minikube (1.8.2) with updated kubectl on Windows 10 Pro updated, Docker Community latest version.</p>

<p>I searched a lot because of every sample for Kubernetes is referring to paths for Unix/Macos.
I found (don't remember where...) that a valid path for Windows should be the one in the sample
path: /c/temp/data/db</p>

<p>But it does not work: Docker is switched on Linux containers, c: shared, Kubernetes in Docker activated, with "describe pod " I get</p>

<p>"didn't find available persistent volumes to bind" </p>

<p>Obviously I tried another disk (shared in Docker), tried "/c/temp/data/db", that is surrounding with ", tried to give all perms to Everyone on this path, /c/Users...nothing</p>

Roberto Alessi
<blockquote>
  <p>I searched a lot because of every sample for Kubernetes is referring
  to paths for Unix/Macos. I found (don't remember where...) that a
  valid path for Windows should be the one in the sample path:
  /c/temp/data/db</p>
</blockquote>

<p>With minikube, you can't mount your local directory into a PersistentVolume as you are trying.  </p>

<p>Minikube creates a virtual machine with Linux and your cluster is running inside this Linux VM. That's why it can't see your files in your windows machine.</p>

<p>To be able to access your local directory into your minikube cluster you need to mount it into your minikube:</p>

<p>You have few options to achieve what you need. The best and easiest way is to start your minikube with the option <code>--mount</code>. This option will mount C:/Users/ by default. </p>

<p>Example: </p>

<pre><code>PS C:\WINDOWS\system32&gt; minikube delete; minikube.exe start --vm-driver=virtualbox --mount  
</code></pre>

<p>If you ssh into minikube Linux VM: </p>

<pre><code>PS C:\WINDOWS\system32&gt; minikube ssh
                         _             _
            _         _ ( )           ( )
  ___ ___  (_)  ___  (_)| |/')  _   _ | |_      __
/' _ ` _ `\| |/' _ `\| || , &lt;  ( ) ( )| '_`\  /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )(  ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)

$
$ df -h  
Filesystem Size Used Avail Use% Mounted on  
tmpfs 1.9G 489M 1.5G 26% /  
devtmpfs 987M 0 987M 0% /dev  
tmpfs 1.1G 0 1.1G 0% /dev/shm  
tmpfs 1.1G 17M 1.1G 2% /run  
tmpfs 1.1G 0 1.1G 0% /sys/fs/cgroup  
tmpfs 1.1G 4.0K 1.1G 1% /tmp  
/dev/sda1 17G 1.3G 15G 8% /mnt/sda1  
/c/Users 181G 106G 76G 59% /c/Users  
</code></pre>

<pre><code>$ cd /c/Users/  
$ pwd  
/c/Users  
</code></pre>

<p>If you want\need to mount any other directory than C:/Users, take a look at <a href="https://minikube.sigs.k8s.io/docs/reference/commands/mount/" rel="nofollow noreferrer">minikube mount</a> and/or <a href="https://minikube.sigs.k8s.io/docs/reference/commands/start/" rel="nofollow noreferrer">--mount-string</a>. You may face some issues with these option depending on your vm-driver. </p>

<p>After mounting your directory you can use it in you PersistentVolume refering to the Linux path that based on my examples it can be /c/Users/myname/myapp/db.</p>

<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: mongo-pv
spec:
  capacity:
    storage: 1Gi
  volumeMode: Filesystem
  accessModes:
  - ReadWriteOnce
  storageClassName: local-storage
  local:
    path: /c/Users/myname/myapp/db
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - docker-desktop
</code></pre>

<p>Please, let me know if my answer helped you to solve your problem. </p>
