This post will guide you to create 4 virtual machine based on Ubuntu Server. One designated to be kubernetes master node and the other three as worker nodes.
This is part of Setup your own kubernetes cluster on VMs series.
This guide is based on Windows but since it's a virtual machine, others OS shouldn't be different
- Install VirtualBox
- Download Ubuntu 16.04 Image for VirtualBox or 64bit Direct link
- Available 2GB of RAM per VM (4 nodes will need at 8GB). You can reduce number of nodes depending on your available RAM
- 10-30GB of disk space per VM (4 nodes will need around 100GB)
You will get something like this.
We will create 4 virtual machines. 1 machine is for kubernetes master and the reset for worker node. They're all mostly the same except hostname. RAM and cpu can be adjusted based on your need. In theory, master node will need less resource comparing to worker node.
We will use bridge network so we have the real network ip address that can talk to the outside world.
- Click "Settings" then "Network".
- Select "Attached to" as "Bridged Adapter"
- Click "Advance"
- Write down "MAC Address" to reserve IP address so that your IP will not change every time the VM restarted
- Click "Settings" then "Storage"
- Click "Adds optical drive" at the top right corner
- Select os image (.iso) you downloaded
- Click OK
Repeat step 1 and 2 with below information
- Name: kubenode1, kubenode2, kubenode3
- RAM: 2048GB (or more)
- Disk: 32GB (or less)
Click "Start" button icon.
Ubuntu setup screen will be shown as below.
Select "Install Ubuntu Server
Follow instructions until this screen and fill "kubemaster" as hostname.
Fill in "Full name", "username" and "password" as needed. Please make note these information.
- "Encrypt your home directory?" : No
- "Partition disk" : "Guided - use entire disk"
- "Write the changes to disks?" : Yes
- "HTTP proxy information" : leave blank (if you are outside company proxy)
- "How do you want to manage upgrades on this system?" : No automatic updates
- "Software selection" : select "OpenSSH server" (This is required if you want you connect to your server remotely using ssh command)
Select "Yes" then "Finish Installation"
Repeat step 4 for "kubenode1" to "kubenode3"
- Don't forget to change hostname to "kubenode1" to "kubenode3" in step 4.2
- Username and password can be the same for all VMs
Now, you have all the VMs with network and ready to setup kubernetes cluster in the next step.