question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HostPath volumes on Mac

See original GitHub issue

Consider a pod like the following:

metadata:
  name: foo
spec:
  containers:
    image: alpine
    name: bar
    volumeMounts:
    - mountPath: /data
      name: baz
  volumes:
  - hostPath:
      path: /Users/user/data
    name: baz

I’d expect this to mount /Users/user/data folder from my host to the container, but apparently what is getting mounted is a folder from the underlying lima VM. My understanding that there is no osxfs/Fuse driver alternative for Desktop in Rancher Desktop? Is there any plans for it? Lima seems to be capable to be translating my local paths to the default VM just fine - maybe it’s a matter of missing configuration?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
janduboiscommented, Sep 26, 2021

I’ve verified that this is indeed broken in RD 0.4.1, but it does work in the latest development builds that will become RD 0.5.0 within the next couple of days.

I strongly suspect that this is due to RD 0.4.1 bundling an older version of Lima, and I think the issue was fixed by https://github.com/lima-vm/lima/pull/247 which was merged into Lima just 11 days ago.

0reactions
janduboiscommented, Sep 27, 2021

That explains it.

Indeed. I forgot that RD 0.4.1 doesn’t map the usual directories. In 0.5.0 the mounts will be like this:

mounts:
  - location: /Users/jan/Library/Caches/rancher-desktop/k3s
    writable: false
  - location: "~"
    writable: false
  - location: /tmp/rancher-desktop
    writable: true
Read more comments on GitHub >

github_iconTop Results From Across the Web

What's the base directory for hostPath volumes in Docker for ...
It seems there is no such thing as a base directory for hostPath volumes at the macOS level. Docker on Desktop works by...
Read more >
Persistent storage using hostPath - OpenShift Documentation
A hostPath volume in an OpenShift Container Platform cluster mounts a file or directory from the host node's filesystem into your pod.
Read more >
How to mount hostPath using docker-for-mac + kubernetes
Have a look at File Sharing under Preferences. There you can see the shared folders. Example for volume, assuming /tmp is in the...
Read more >
[k8s] How to mount local directory (persistent volume) to ...
I tried to mount hostPath (the default StorageClass created by Docker Desktop) like below: Check and add the directories you want to share...
Read more >
Persistent Volume for Kubernetes w/ ACL Support on Mac
Then, I moved to a volume mounted directly via hostPath, which, ... Docker Desktop for Mac installed; Kubernetes cluster enabled.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found