Deploy Kubernetes Cluster on Workstation Using VirtualBox

Deploy Kubernetes Cluster on Workstation Using VirtualBox


This page describes how to create a minimal on-premises Kubernetes cluster on a workstation using VirtualBox.


  1. Create virtual machines with Kublr
  2. Create a Kubernetes cluster


Create virtual machines

You will need to to create 3 virtual machines:

  • a VM for Kublr with Ubuntu Server 18.04, 1.5 GiB RAM and 10 GB disk space
  • a VM for the master node with Ubuntu Server 18.04, 5 GiB RAM and 10 GB disk space
  • a VM for the worker node with Ubuntu Server 18.04, 4 GiB RAM and 10 GB disk space

Additional requirements:

  • The master and worker nodes should be accessible from the Kublr VM via SSH with sudo with no password
  • The Kublr VM should expose port 9080 to the host to make the Kublr UI accessible to the administrator

Create a directory and go there:

mkdir my-cluster
cd my-cluster
touch Vagrantfile

Edit Vagrantfile via your favorite IDE or editor. Here is example content:

Vagrant.configure("2") do |config| = "ubuntu/bionic64"
  config.vm.define "kublr" do |kublr| "private_network", ip: KUBLR_IP
    kublr.vm.provider "virtualbox" do |vb|
        vb.memory = 1536 #1.5G
    kublr.vm.provision "docker" do |d| "kublr", # --name kublr
            image: "kublr/kublr:1.22.2",
            daemonize: true, #-d
            restart: "unless-stopped", # --restart=unless-stopped
            args: "-p 9080:9080"
    kublr.vm.provision "shell", inline: "docker exec -i kublr /bin/bash -c 'echo \"KUBLR_HOST=#{KUBLR_IP}:9080\" > /ip.external'; docker restart kublr"
  config.vm.define "master" do |master| "private_network", ip: MASTER_IP
    master.vm.provider "virtualbox" do |vb|
      vb.memory = MASTER_MEMORY_MB
  config.vm.define "worker" do |worker| "private_network", ip: WORKER_IP
    worker.vm.provider "virtualbox" do |vb|
      vb.memory = WORKER_MEMORY_MB

Pay attention to VM IPs:


Make sure that they belong to a private address space, but not to an existing local network. Vagrant will create a corresponding private network.

Bring up the infrastructure:

vagrant up

It takes a few minutes to create the VMs and install Kublr

Kublr UI will be available at (with login / password admin / kublrbox)

Add SSH keys

Go to the Credentials tab and add the SSH private key for the master VM The key itself is stored in .vagrant/machines/master/virtualbox/private_key

Add Master Key

Add the key for the worker VM It is stored in .vagrant/machines/worker/virtualbox/private_key

Create Cluster

  1. Click on Cluster Menu in Left Navigation Menu Bar

  2. Click on Add Cluster Add New Cluster

  3. Enter Cluster Name.

  4. Select Provider: Bring Your own Infrastructure Provider

  5. Click the INSTANCES step.

  6. Use the Master Configuration section.

  7. Enter master parameters:

    • User Name: vagrant
    • SSH Key Name: the private SSH key for the master VM added before
    • IP/DNS of Master 1: IP of the master VM specified in Vagrantfile Master
  8. Scroll to the Instance Group section (default name group1).

  9. Specify the parameters of the worker node(s) in your group as described below:

    • User Name: vagrant
    • SSH Key Name: the private SSH key for the worker VM added before
    • Add IP/DNS Addresses: IP of the worker VM specified in Vagrantfile Worker
  10. Click the SETUP FEATURES step.

  11. Leave the following options disabled: Ingress Controller, Self-Hosted Logging, Self-Hosted Monitoring Features

  12. Click the REVIEW AND CREATE step.

  13. Review the summary and click CONFIRM AND INSTALL button.

    In a few minutes the cluster will be created.