WSL Kubernetes Pod stuck in ContainerCreating state due to volume mount WSL Kubernetes Pod stuck in ContainerCreating state due to volume mount kubernetes kubernetes

WSL Kubernetes Pod stuck in ContainerCreating state due to volume mount


You must use this format for the path:

/run/desktop/mnt/host/c/someDir/volumeDir

So in your case it is:

/run/desktop/mnt/host/c/kubernetes/typo3-8/mysql-storage/

source for solution

UPDATE: You really don't want to use windows host directories inside WSL2 distro because it is really really poor performance. Use the WSL2 distro directories instead that you can access just as easily from the host windows on this address \\wsl$


As described in the following example taken from here, the path shouldn't end with /.

apiVersion: v1kind: PersistentVolumemetadata:  name: example-local-pvspec:  capacity:    storage: 500Gi  accessModes:  - ReadWriteOnce  persistentVolumeReclaimPolicy: Retain  storageClassName: local-storage  local:    path: /mnt/disks/vol1  nodeAffinity:    required:      nodeSelectorTerms:      - matchExpressions:        - key: kubernetes.io/hostname          operator: In          values:          - my-node

Changing your path to path: /c/kubernetes/typo3-8/mysql-storage makes the magic and your PVC works as designed.