Vagrant ubuntu virtualbox build

Hi, couple of points on the appendix of " Kubernetes for the Absolute Beginners - Hands-on Tutorial".

The one in the CKA github should work. I updated it earlier this month, and it’s been verified by @rob_kodekloud and @al1
Redeploy the VMs and be sure to follow the instructions carefully. If you see any errors in the output of vagrant up, please paste here

in code block

Thanks, are you saying the one in the link I provided works? or are you referring to another repo ?

It does indeed. The repo pointed to by the video has been updated, as Alistair says.

I see the problem. BRIDGE mode is causing the issue. NAT is fine. Using BRIDGE mode one of the worker IPs doesn’t get allocated to /etc/hosts. It ends up looking like this…

192.168.1.18 controlplane
node01
192.168.1.20 node02

But I can ssh to all the nodes so must be something going on with ip detection during build. Might be my network :slight_smile:

How many devices are connected to your home network? It is possible that the DHCP server in your router has run out of addresses to allocate. You can check this from the admin console of your router.

If you get a load of friends to come round and connect their phones to your wifi, and some people fail to connect then this is definitely the issue.

Thanks Alistair. I switched to NAT which works fine but I’ll test again when I’m back on my stable network. The network had loads of addresses spare and the controlplane and node01/02 all had assigned IPs. It was just the hosts file not populating but I’ll take another look.
One other thing I noticed about the demo was the systemd cgroups driver configuration (9:00 in the demo2 video) doesn’t work. I ended up with hundreds of errors in the apiserver log with kube system pods constantly restarting. The config.toml was 100% correct and exactly as the video and the docs describe but still didn’t work. Then I found a note in the docs to fix container crash loops. The fix was to run “containerd config default” to create a new config.toml file. Then find the systemdcgroups value and set to true.

Yes, and if you follow the github version, which is much more recent than the video, then it will work. The video is out of date and not in sync with the github version. I update github whenever it needs updating, but I have no input on the schedules for recording videos. It has been pointed out internally that the videos need to be updated.

Also check that the adapter it is selecting for bridge mode is the one you expect it to be. If you’re connected via WiFi, then what is returned by the following should be the name of the WiFi adapter.

  • If your machine is Windows, open a PowerShell command prompt and run
    Get-NetRoute -DestinationPrefix 0.0.0.0/0 | Get-NetAdapter | Select-Object -ExpandProperty InterfaceDescription
    
  • If it is Intel Mac, run this in mac terminal
    iface=$(netstat -rn -f inet | grep '^default' | sort | head -1 | awk '{print $4}')
    interface=$(VBoxManage list bridgedifs | awk '/^Name:/ { print }' | sed -e 's/^Name:[ ]*\(.*\)/\1/' | grep $iface)
    echo $interface