Create a local kubernetes cluster using virtualbox. A modification of the great work danielepolencic did in his gist. and LocusInnovations did in his modifications
Please use install-virtualbox-6-with-vagrant-in-ubuntu-mint gist if you need to install virtual box and the vagrant.
The vagrant file will do the following:
- Provision all local VMs using VirtualBox
- Patch the OS
- Install Docker
- Install k8s control plane
- Initialize cluster with Flannel CIDR block & install Flannel
- Join the nodes to the master
- Create alias in vagrant home for kubectl...just use k
$ git clone https://github.com/iamdamith/k8s-vagrant-virtual-box
$ cd iamdamith/k8s-vagrant-virtual-box
You can create the cluster with:
$ vagrant up
You can delete the cluster with:
$ vagrant destroy -f
SSH to Master and other Nodes:
$ vagrant ssh master
$ vagrant ssh worker1
$ vagrant ssh worker2
If you are getting this 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: 10.0.0.10 Ranges: 192.168.56.0/21
Valid ranges can be modified in the /etc/vbox/networks.conf file. For more information including valid format see:
https://www.virtualbox.org/manual/ch06.html#network_hostonly
Please create /etc/vbox/networks.conf and add
* 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12