- Reproducible local Kubernetes labs for practicing kubeadm-based installs.
- Consistent network and host configuration across machines.
- Simple automation for VM creation, provisioning, and SSH access.
- Install VirtualBox (download from https://www.virtualbox.org).
- Install Vagrant (installation documentation at https://www.vagrantup.com/docs).

- Clone the course repository (replace
<repo-owner>and<repo-name>with the real values for your copy):
- Change into the repository and confirm the Vagrantfile is present:
/vagrant and runs shell provisioners to configure /etc/hosts and DNS.
Key excerpts (abridged) from the Vagrantfile:
- Base box:
ubuntu/bionic64. - Host-only network:
192.168.56.0/24(configured vianode.vm.network :private_network). - SSH forwarding: the Vagrantfile forwards each VM’s port 22 to a host port, allowing
vagrant sshand direct SSH via the forwarded port. - Provisioners: the scripts
setup-hosts.shandupdate-dns.share run inside each VM to populate/etc/hostsand update DNS.
- Check VM state:
- Create and provision all VMs:
- Download the base box (
ubuntu/bionic64) if needed. - Create and configure the VirtualBox VMs.
- Run the configured shell provisioners (e.g.,
/vagrant/ubuntu/vagrant/setup-hosts.sh).
vagrant up shows logs like:
Troubleshooting: Guest Additions
If you see a message about Guest Additions version mismatch (for example, “Guest Additions Version: 5.2.42, VirtualBox Version: 6.1”), it usually does not prevent SSH or provisioning. However, shared folder (synced folder) support can fail in some cases. If you encounter shared-folder problems, install matching Guest Additions inside the VM or update VirtualBox on the host so versions align.
vagrant ssh <name> to access other nodes.

- Install VirtualBox and Vagrant on the host machine.
- Clone the course repository to obtain the Vagrantfile and provisioning scripts.
- Inspect the Vagrantfile to learn about VM roles, memory/CPU, network, and forwarded ports.
- Run
vagrant upto create and provisionkubemaster,kubenode01, andkubenode02. - Use
vagrant ssh <name>to connect to each node and validate the environment.
- Initialize the Kubernetes control plane on the master node with
kubeadm init. - Configure
kubectlon the master and copy the join command to add worker nodes. - Run
kubeadm joinon each worker to complete the cluster setup.
- VirtualBox: https://www.virtualbox.org
- Vagrant documentation: https://www.vagrantup.com/docs
- Kubernetes (kubeadm): https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/