Volume mounts not working with kind on Docker Desktop MacOS

I’m experimenting with kind for my kubernetes nodes and ran into some issues with volume mounts.

I was running some dev pods with the local source code mounted. When starting up the pods with kind nearly everything in the mounted folder was missing in the pod. Switching back to kubeadm resolved the issue.

Docker Desktop 4.42.1 (196648)
Engine: 28.2.2
Compose: v2.37.1-desktop.1
Credential Helper: v0.9.3
Kubernetes: v1.32.2

I’m using the default File Sharing config which includes /Users.

Kustomize is used for config management and the startup script is using envsubst to set the path to the source like this

kubectl kustomize "${ROOT_DIR}/kubernetes/${env}/" | APP_PATH="${ROOT_DIR}" envsubst | kubectl apply -f -

volume mount config

volumes:
  - name: app
    hostPath:
      path: $APP_PATH
...
volumeMounts:
  - name: app
    mountPath: /app

from a pod using kind

[root@web-f5c9b464d-z4pm9 app]# ls -al /app
total 12
drwxr-xr-x 3 root root 4096 Jun 20 15:30 .
drwxr-xr-x 1 root root 4096 Jun 20 16:53 ..
drwxr-xr-x 3 root root 4096 Jun 20 15:30 config

from a pod using kubeadm

[root@web-586c588ff7-8jk2x app]# ls -al /app
total 100
drwxr-xr-x 43 root root  1376 Jun 20 16:19 .
drwxr-xr-x  1 root root  4096 Jun 20 17:35 ..
drwxr-xr-x  9 root root   288 May 20 12:36 app
drwxr-xr-x  4 root root   128 Jun 20 15:20 appconfig
-rw-r--r--  1 root root  3440 May 20 12:36 app.json
drwxr-xr-x 42 root root  1344 Apr 29 11:40 bin
... 

i can’t even mount a folder from the host. It doesn’t exist in the kind host. from which the pod could mount it. If enable “Show system containers” on the Kubernetes settings page, I can click on the kubernetes node containers in the list of containers and inspect. These are the mounts

	"Mounts": [
		{
			"Type": "bind",
			"Source": "/etc/kind/hosts.toml",
			"Destination": "/etc/containerd/certs.d/_default/hosts.toml",
			"Mode": "ro",
			"RW": false,
			"Propagation": "rprivate"
		},
		{
			"Type": "bind",
			"Source": "/lib/modules",
			"Destination": "/lib/modules",
			"Mode": "ro",
			"RW": false,
			"Propagation": "rprivate"
		},
		{
			"Type": "volume",
			"Name": "a916ca20a316bc4366d87ab3600840f99eea2e47f0a3fbfa88e2eaaf889eb5e4",
			"Source": "/var/lib/docker/volumes/a916ca20a316bc4366d87ab3600840f99eea2e47f0a3fbfa88e2eaaf889eb5e4/_data",
			"Destination": "/var",
			"Driver": "local",
			"Mode": "",
			"RW": true,
			"Propagation": ""
		}
	],

You could report it on GitHub

But I’m not sure why your pod creation didn’t fail