-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Suggest NFS as default filesystem for local dev #1889
Comments
This seems to have fixed #1839 for us. |
I've been doing this for a couple of weeks now, because the 9p driver has reliable data inconsistency. This is the only way I've been able to create a reliably functioning, reasonably performing I'm not sure why the PersistentVolume is neeed, though. For "local" storage (e.g. |
By the way, this also "fixes" (obviates the need to fix) the data inconsistency problems with 9p as outlined in #1515. |
Cool! You might want to consider starting with extending |
BTW, Windows won't work with NFS (AFAIK), so you should also consider how you might want to implement things like CIFS / Samba sharing and/or |
@nathanleclaire I believe you can get NFS working with Cygwyn, but our windows dev is back tomorrow so we will experiment. And yeah sounds like a good plan, we actually don't need all of /Users mounted either, I'm going to narrow that down to just our dev directory. |
In our use case, broadly mounting
|
Yeah, no doubt NFS is the fastest of commonly available options. I've definitely seen it have some odd behavior though, so just tipping you off (like you noted, sometimes it also just chugs along without issue as well). There's also a few quirks in setting it up you might want to document -- I recall having to change a setting on my Mac to allow access to lower (more privileged) ports from the VM. As far as the |
@nathanleclaire Since we're having this conversation ... have you automated this solution at all? We're in the early stages of doing so, in order to move to a |
@alanbrent Automated setup of NFS? I haven't but usually to try it out I've used https://github.com/adlogix/docker-machine-nfs (this is what I was referring to about the ports IIRC). That shell script should be relatively translatable to Go code. |
@alanbrent I do, i have a shell script that automates the complete dev environment setup (on a mac, and more or less on a PC, would be easy to port to linux as well). it does the following:
All is non destructive so if something happens midway through or you need to delete something and recreate it all works with that. |
@alanbrent @nathanleclaire no real need to automate:
|
Well, you've got to consider mount / export deletion. As well as things like what happens if the VM IP address changes. As well as elegantly handling the root privilege of doing so (e.g., Vagrant has a section on this ) and making sure the right commands are run for users of other Unixes. I run |
This makes a lot of sense, we should definitely document how to get NFS working with minikube on each platform. We can also look at extending 'mount' in the future to make setting up the NFS server easier. |
On that note @aaron-prindle do you know of anyone that's gotten NFS working on Windows? We're struggling with it currently. Using Cygwin. |
Hi all. This is the thread for me! I've been suffering from very slow disk i/o in my default /Users mount (xhyve on OS X), and also the issue at #1515. However, I'm a bit of a novice by comparison, so don't quite understand what I need to do to experiment with NFS. @eecue is there any chance you could share your @alanbrent I was also wondering why the PersistentMount is required, but didn't understand your comment:
Thanks for any help you can offer! |
Yes. We've just moved from vbox+vboxfs to xhyve+NFS and it's really cool. CPU usage has decreased 4 times, response time the same. It would be really cool if it was automated in minikube and set to default. @georgecrawford |
This is a good workaround but I think adding nfs as a requirement to use minikube is too much of a barrier. That said I suffer from the constant crashing as well. I wish I had a constructive advice but my hope is that the current experience remains the status quo and we don't end up with a much harder to use tool. Thanks for listening (: |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
docker-machine-nfs solves this really reliably for docker-machine. I wonder if it's possible to port it to minikube and run it after the fact as like minikube-nfs or something. |
/remove-lifecycle rotten |
Looks like someone already did it: |
/close |
@huggsboson: you can't close an active issue unless you authored it or you are assigned to it, Can only assign issues to org members and/or repo collaborators.. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I create a blog post for setting up a Minikube NFS mount. This way containers can mount source code on the host machine with great performance! http://pietervogelaar.nl/minikube-nfs-mounts |
Is also 9p giving problem with os.rename? |
We use nfs too. But it have a thing. Nfs doesn't support inotify events, so nodejs watchers don't work :( |
I would love to see documentation suggesting that NFS as a more performant alternative for power users, but I hesitate to suggest it as the default unless the user experience is relatively painless. For instance, automatically editing /etc/exports files. If we could make --nfs an option to mount, then I'd be more than happy to switch it as the default, and fall-back to 9p/vbox/etc if it isn't available for some reason. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Just using https://github.com/vapor-ware/ksync is also a great alternative. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@eecue I'm on macos Catalina and because of that have to mount to Following your
However if I change the ip to be localhost I can verify that mounting locally (not from within minikube) does work. Have you tried this on Catalina? And if so I would love some pointers on how you set it up to work. |
Silly me I was using the wrong server IP in the PV. My nfs setup on macOs Catalina if anyone gives this a shot themselves. echo "/System/Volumes/Data/Users/xyz -alldirs -mapall="$(id -u)":"$(id -g)" $(minikube ip)" | sudo tee -a /etc/exports
sudo nfsd restart
# Verify the export appears
showmount -e
# Get the local ip that is exposed to minikube
# This will be used as the server ip
ifconfig bridge100 | grep inet
nfs:
server: <nfs-server-ip>
path: /System/Volumes/Data/Users/xyz |
You can also test this by: minikube ssh
mkdir test-mnt
sudo mount <nfs-server-ip>:/System/Volumes/Data/Users/xyz test-mnt |
Is this a BUG REPORT or FEATURE REQUEST? (choose one): FEATURE REQUEST
Please provide the following details:
Environment:
Minikube version: v0.21.0
What happened:
We noticed our application ran significantly slower in k8s/minikube compared to vagrant. We changed our local files to mount via NFS instead of 9p and our dev system is now much faster than vagrant.
What you expected to happen:
We should update the docs to recommend using NFS for local dev instead of 9p, at least for OS X, but probably makes sense on linux, too. We're going to test on Windows shortly to see if it has the same effect which I assume it will.
How to reproduce it (as minimally and precisely as possible):
Set up a persistent volume store using NFS and use it instead of 9p:
/etc/exports
to allow minikube to access it:$ echo "/Users -alldirs -mapall="$(id -u)":"$(id -g)" 192.168.99.100"| sudo tee -a /etc/exports
Anything else do we need to know:
If you think this is a good idea, I'll make a PR for the update docs. It's been life changing for our devs.
The text was updated successfully, but these errors were encountered: