- VirtualBox – a hypervisor for running the VMs.
- Vagrant – an automation tool that spins up multiple VMs from a single configuration file.
Before you begin, ensure that both VirtualBox and Vagrant are installed on your system.
- For VirtualBox, download the installer from virtualbox.org.
- For Vagrant, refer to the Vagrant documentation for installation instructions.
- Copy the repository URL from the code dropdown.
- Open a terminal and execute the command below to clone the repository:
ls and verify that the Vagrantfile is present. Open the Vagrantfile to review its configuration.

Vagrantfile Configuration
The provided Vagrantfile is set up to provision one master node and two worker nodes. It assigns specific IP addresses within the 192.168.56.x network, although Kubernetes configuration will be added later. Below is an excerpt from the Vagrantfile demonstrating the basic configuration:Checking Vagrant Status
Before creating the VMs, you can verify their current state. Since the VMs have not yet been created, running the command below will show that all nodes are in the “not created” state:
Bringing Up the VMs
To provision all VMs, run the following command:- Importing the base box.
- Configuring network interfaces.
- Executing provisioning shell scripts.
- Replacing the default insecure SSH key.
Accessing the VMs
You can access any VM using thevagrant ssh command followed by the VM’s name. For example, to connect to the master node, run:
logout.
Next Steps
With all VMs provisioned and accessible, the next phase is to bootstrap the Kubernetes cluster using kubeadm. This step will configure the cluster components on each node and prepare the environment for running Kubernetes workloads.This guide demonstrated automated provisioning of a multi-node Kubernetes cluster with Vagrant and VirtualBox. By using a consistent Vagrantfile, you ensure that each learner sets up an identical environment for a smooth Kubernetes deployment experience.