[Windows][K8s-Kind] pods do not have access to host directories

Dear folks,

I want to create helm chart in my Dev environment, and I want to run it in Prod as well… but I cannot access files, and due to that even AI fails to find a solution for this matter, gorden, chatgpt, grok, etc…
The issue is Docker Desktop does not give access to host/mnt/<anything> and also does not provide access to shared directory defined in docker-desktop…

while it exists you cannot map storage to your application running on k8s… also if you are going to attach the file as base64 inside the helm the helm get big and fails…

although there seem to be other-ways left untested, they do not seem fitting and beneficial, and also force decision that cannot be taken for long run and trusted plan…

What should I do?

Should I remove K8s and switch to another platform? what is there that I can do directly within windows without going for VM platforms…

Spec:
Windows 11
WSL 2
File sharing active: attached D:\ drive
Containerd Image Store activated
K8s:

  • Cluster: Docker-desktop
  • Choose cluster provisioning method: Kind
  • kind: 1 node, v1.35.1

Thank you,
Hassan F.

Kind runs containers to use as Kubernetes nodes, so when you mount something from the host, that will be from the container-based node. I guess Docker Desktop could support mounting a common directory into all container-based nodes it would not be available in production. What you could still do is run an NFS server using Docker and mount NFS volumes into your containers on all container-based nodes. As far as I remember host.docker.internal should work as a hostname if you forward ports to the NFS container, and I assume you could also connect the nfs-server container to the “kind” network so Kubernetes containers could access the nfs server directly.

If you really want to use host mounts, you would probably need to switch back to “kubeadm” in Docker Desktop.

You could also try alternatives like “Rancher Desktop”. Some Rancher components are also used in Docker Deskotp like the local path provisioner.

Some deployments are big even without including a base64 encoded file. In those cases adding --server-side to kubectl apply: Server-Side Apply | Kubernetes