Kubernetes cluster setup on local environment for testing purpose using Virtualbox and vagrant

I have tried severally to set this 3 node cluster locally using the Vagrantfile from the kubernetes training. My nodes always end up with IP from the NAT adapter1 of the Vm which is 10.0.2.15. Same IP on all nodes and PODs. I have tried several times. What may be wrong please. CoreDNS and flannel PODs end up in ContainerCreating and CrashLoopBackOff respectively.

Are you modifying the Vagrant file in any way? The current Vagrantfile in the kubeadm-clusters/virtualbox directory does not work the way you describe. At a minimum, make sure you are using the full tutorial, which should prevent the error you are describing – see the Node Setup page for details.

Initially, I did not modify the Vagrantfile, my nodes were not getting the 192.168.56.X IP range, they were getting IP from my Host PC wireless network or 10.0.2.15. I then used AI to create another Vagrantfile and it worked. I noticed the second network adapter was set to Host-only network.

So I came back to the kodekloud Vagrantfile and modified the code to switch from bridged network to Host-only network and my pods came up, and the nodes were able to pick the 192.168.56.X IP range. All pods came up well using flannel CNI.

Thank you.

Hi @shenken007 !
I’m facing the same issue. could you please share your Vagrantfile with me?