mmumshad / kubernetes-the-hard-way

Bootstrap Kubernetes the hard way on Vagrant on Local Machine. No scripts.
Apache License 2.0
4.7k stars 4.54k forks source link

Ip Range Issue #282

Closed mykefon closed 2 years ago

mykefon commented 2 years ago

I keep getting the error " The IP address configured for the host-only network is not within the allowed ranges. Please update the address used to be within the allowed ranges and run the command again. Address: 192.168.5.11 Ranges: 192.168.56.0/21. "

It manages to partially create 1 master node.

Screen Shot 2022-06-03 at 3 32 12 PM
m18unet commented 2 years ago

Hi @mykefon, what is your operating system? Are you using vagrant in WSL2?

vherzog commented 2 years ago

@mykefon I ran into this as well (on MacOS Big Sur). What worked for me is changing the IP_NW in the Vagrantfile to "192.168.56.". Found this thread -> https://stackoverflow.com/questions/70704093/the-ip-address-configured-for-the-host-only-network-is-not-within-the-allowed-ra

mykefon commented 2 years ago

@m18unet I used VSCode on MacOS Monterey.

mykefon commented 2 years ago

@vherzog I'll try that...Thanks!

jaypan13 commented 2 years ago

Just started looking to this guide. Thank you!

image

image

Workaround given by @vherzog is working!

Update - Realized that this IP range should be matching with whatever virtualbox hostonlynetwork netaddress. I found that on other machine this needed to change to .62 as my friend had changed it.

  1. Run vboxmanage list hostonlyifs
  2. Get IPAddress for the network having status = Up
  3. Use that IP address instead of .5 or .56. Just make sure that you also change IP range from .5 to .56 in other shell files from the vagrant folder or else it will not work.

image

fireflycons commented 2 years ago

Hi,

We are shortly going to release an updated version to kubernetes 1.24. With this upgrade we are including instructions to easily set the host network range to suit individual requirements, and the default network will be 192.168.56

Please check back in a couple of weeks.

Thanks