Tutorial: Setting Up VirtualBox (on Windows), Docker, KIND and kubectl client (on Debian VM)
In this tutorial, we'll cover the steps to set up VirtualBox on a Windows machine, import a Virtual Machine (VM) template with a bridged network configuration, install Docker on a Debian VM, and finally install KIND (Kubernetes IN Docker) for local Kubernetes cluster management.
Prerequisites
- Windows machine with administrative privileges
- Stable internet connection
Steps
1. Installing VirtualBox on Windows
VirtualBox is a free and open-source virtualization software that allows you to run multiple operating systems simultaneously on a single machine.
- Go to the VirtualBox downloads page.
- Download the installer for Windows.
- Run the installer and follow the on-screen instructions to complete the installation.
- Once installed, launch VirtualBox.
2. Importing a VM Template with Bridged Network
Now, let's import a Virtual Machine template with a bridged network configuration.
-
Obtain a VM template file (usually in OVA or OVF format):
-
If want install Docker, Kind, kubectl, download this-> Kind-to-insall
-
If you want to have a working cluster, download this -> Kind-ready
-
-
In VirtualBox, go to
File -> Import Appliance. - Browse and select the VM template file.
- Follow the import wizard, ensuring to select "Reinitialize the MAC address of all network cards" and "Import Hard Drives as VDI" options.
- After importing, select the imported VM from the VirtualBox interface and go to
Settings -> Network. - Under Adapter 1, select "Bridged Adapter" in the Attached to dropdown menu.
- Choose your network adapter from the Name dropdown.
- Click OK to save the settings.
3. Connecting to your Debian VM
We'll now install Docker in the Debian VM.
- Start the Debian VM in VirtualBox.
- Login to the Debian VM from VirtualBox window using username: student and password: student2024
- Aquire the ip of the VM
student@kind:~/kubernetes-training/docs/setup$ ip a s enp0s3 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 08:00:27:e1:9d:81 brd ff:ff:ff:ff:ff:ff inet 172.30.0.148/24 brd 172.29.0.255 scope global dynamic enp0s3 valid_lft 86319sec preferred_lft 86319sec inet6 fe80::a00:27ff:fee1:9d81/64 scope link valid_lft forever preferred_lft forever - You are interested in this line: However, the ip address may be different but you want to get something like this 172.30.0.148
- Grab an SSH client. One option can be Putty Putty Download Link
Now open putty and insert in the
Host Name (or IP address)field the ip obtained at the previous step. Click Accept on the next window and login using the username and password provided at step 2. - From now on you will be using the Putty SSH client to connect to your VM (or your prefered ssh client). Not using a SSH client will prevent you from copying/pasting commands or text to your VM.
4. Installing Docker in Debian VM
- Download Docker installation script:
- Install Docker by running:
- Add student user to docker group:
5. Installing KIND
- Install KIND using the provided script:
6. Installing kubectl
- Install kubectl client using the provided script:
- Install and enable kubectl autocompletion for bash: