-
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
Support for predictable IP's across restarts #951
Comments
This also happens with the kvm driver, but not with the virtualbox driver. Would be great if one could force a fixed IP address when using |
There is an option with the xhyve driver to set a static IP. By setting a static UUID here [0], you can ensure that you get the same IP across deletes/starts. We had this feature enabled for awhile but disabled it again because there were some issues. The discussion of the issues starts with this comment and continues in this issue. [1] I think that this is a great feature to have, we just need to figure out the networking issues. [0] https://github.com/zchee/docker-machine-driver-xhyve/blob/master/xhyve/xhyve.go#L70 |
Same here. I have been seeing the issue that the IP address of VM changes across restarts. |
I'm seeing this with the |
@georgecrawford There's a workaround by manually (or programmatically) updating |
I've by now seen this also with the virtualbox driver: typically my VM is 192.168.99.100, but sometimes it ends up as .101 or similar. Removing the minikube VM in those cases seems to help. |
Same issue here. I'm using KVM and I don't even delete the cluster. I simply stop and start it again. I even tried to change dnsmasq's configuration to limit the DHCP's address range. Didn't make a difference. |
Same issue with vmwarefusion driver on OSX. |
Also occurring for minikube v0.19.0 with Virtualbox 5.1.18 on Windows 10 x64 Build 14393.1198.
Assigned IP address has so far incremented from 192.168.99.100 to 192.168.99.105 |
The IP address for Minikube changes on Max OS with xhyve driver. It would be great to use static IP address as we're developing apps in Pycharm remotely on Minikube pods. This way we have a full working copy of the whole environment on developer's machine. When IP changes, we need to reconfigure dozen projects in Pycharm which takes lots of time. |
its, would be great to have feature set static ip in minikube, any temp solution for this ? |
I've also seen this with the Hyper-V driver. Stopping and starting appears to fix the issue until you connect to a new network. |
Yeah, this isn't a feature, as it makes dnsmasq harder to configure. Now you can't map domain names to a single IP. Looking for any workaround here. |
@squillace On Mac: minikube start |
Having the DHCP addresses reset after a login/logout or some other trick isn't a good solution. What if I want to work on minishift for a while before I start up minikube? What if I have a test kitchen run running that uses VirtualBox? The solution that micheletedeschi posts (there's 2 comments from him) in docker/machine#1709 works pretty well for docker-machine. If minikube had a similar way to run arbitrary scripts at boot up then that would be one quick way to solve the problem in a way that doesn't remove the option for a command line flag in the future. |
I agree, it's a workaround/hack and it should only be used in situations where you don't have a bunch of other VMs that you need to worry about running on VirtualBox. I should have indicated that in my previous post, thanks for posting this. And yes, minikube definitely needs to have a way to use a static IP. |
Although I am now experimenting with adding an option In my case, I am experimenting with Hyper-V as it allows to pass data to the VM, but so far I none of the other hypervisors do this. This means that the value can be passed into the VM before it has even tried to get an IP address (before the docker-machine provisioning started). Since it would several problems we have with Hyper-V: minishift/minishift#418 #1627 it is my focus for the moment. If you have other suggestions, please let me know... especially when it concerns the other hypervisors. |
Static IP address option for Minishift using HyperV is being worked on as minishift/minishift#1316. I am coordinating with @aaron-prindle to see if this can also work for minikube. |
PR with a possible solution is available at Minishift's repo for testing. Instructions are here: minishift/minishift#1316 (comment) |
https://willwarren.com/2015/04/02/set-static-ip-address-in-vmware-fusion-7/ The link above helped me with VMWare Fusion |
New user of minikube and kubernetes-cli here. I have this issue of changing minikube ip too, on mac. The driver is Hyperkit commit 3e3161, minikube v0.24.1, kubectl 1.8.0 (client and server). If it will be possible to integrate setting a static ip for the VM in minikube, would that work for every driver? |
Same issue, doesn't matter which vm driver used. |
Hi @gbraad, Best regards! |
So I was experimenting with export HOSTALIASES (you can have your userspace personal hosts file. Works on Ubuntu, HOWEVER not working on Mac) Would be nice to just map Well i still decided to go that path with sudo to update /etc/hosts. (after minikube start) Not ideal but it works. All provisioning scripts after that reference minikube.local hostname. EDIT: use below at your own risk. test on a copy of hosts first before you set against your system file. Tested on Macbook. It detects the line with minikube and replaces entire line with new line and new ip - puts a tab in between. Yes it asks for root pass, yes its bad, yes it works.
|
|
using vbox under win10, just edit such file, change the ip and restart minikube. |
hyperkit has uuid which is used in MAC address generation, when you start the machine with UUID like
the MAC address stays the same even if you delete the machine - the IP addresses can be changed in |
Based on comments #951 (comment) , #951 (comment) I created a multi OS support variant of the "workaround" script because I needed to support both MacOS and Linux systems. |
Maybe I can help someone else. First I put VBox 6.* and then I had a problem with changing the ip address, then I made downgrade on VBox 5.2. |
I experienced a bit unstable VirtualBox Manager (GUI) with this. |
hi, for anyone interested, i worked around this with a simple static ip. Disadvantage is, its not returned with "minikube ip". But since i can configure it thats not a big problem.. regards, |
Marking as a backlog item, because I don't believe this will be likely possible to do consistently across hypervisors until we migrate away from |
This is still an ongoing thing for me as well. Do we have any additional information in regards to this? |
The lease deletion workaround implemented as a bash script for ubuntu users:
-- edit: |
on docker driver we could do this : #7756 I would be happy for anyone who like to pick that issue first for docker driver, and then later we could do same logic for KVM and virtualbox |
I'm closing this admittedly popular, but overly broad issue, because it is effectively unsolvable for all drivers we interact with. It is not currently a priority for the maintainers to address this issue, but PR's are certainly welcome to introduce predictable IP support for a particular driver. I caution that doing so may be tricky, particularly when running multi-cluster and/or multi-node configurations. |
Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT
Minikube version (use
minikube version
):v0.14.0
Environment:
xhyve
1.11.1
What happened:
Minikube changes IP address when recreated.
What you expected to happen:
Minikube should retain the IP address when deleted and created again.
How to reproduce it (as minimally and precisely as possible):
minikube start --vm-driver=xhyve
minikube ip
(note the IP address)minikube stop
minikube delete
minikube start --vm-driver=xhyve
minikube ip
(IP address has changed)Anything else do we need to know:
I have several things configured to Minikube's IP address and have to recreate it occasionally. They all have to be reconfigured each time. It would be convenient to have Minikube not change its IP address after deleting and recreating.
The text was updated successfully, but these errors were encountered: