6/20/22

Install Harvester on Bare Metal Cloud using ISO Image

Rancher Harvester is an open-source hyper-converged infrastructure platform designed to run modern cloud-native workloads on bare metal servers and it is completely open-source and free to use. Traditional Type 1 Hypervisors are complicated to set up on bare-metal hardware and it usually involves many storages, network, and other peripheral device configurations. We will cover on deploying rancher harvester on bare metal cloud instance and setting up your first virtual machine in rancher harvester. I am going to use vultr as a bare-metal cloud provider (Get $100 free vultr credit to setup your harvester cluster), you can use any cloud provider or you can even use your HomeLab/Self Hosted environments.
Rancher Harvester is built on top of Kubernetes using
  • Longhorn - lightweight, reliable, and easy-to-use distributed block storage system for Kubernetes.
  • Elemental for openSUSE Leap 15.3 - Linux distribution designed to remove as much OS maintenance as possible in a Kubernetes cluster.
  • KubeVirt - virtual machine management add-on for Kubernetes which leverages KVM and libvirt to allow running virtual machines inside of Kubernetes cluster.

Installation

Login to your vultr management console and click on deploy a new server.

Vultr Management Console



Select bare metal cloud instance, select server location, select initial pre-installed OS, and select server size and disk configuration. You can enable IPv6  (optional) and add an SSH key. Give hostname to your instance. Click on deploy.

Rancher Harvester Vultr Bare Metal

It will take a couple of minutes to provision and spin up your new server instance, So please be patient. I have selected a 2 * 240 GB SSD instance. So we will get two disk partitions /dev/sda and /dev/sdb. In /dev/sda (this has pre-installed Ubuntu 22.04 LTS OS running on it) and /dev/sdb which is formatted empty drive. 

Rancher Harvester Vultr Instance Up

Click on the server instance, and you will find the server IP, username, and password. ssh into the server instance using the server username and server password which is given in the vultr server management console.

Vultr ssh to console


Run the below commands in your terminal. This will download the rancher harvester ISO image from Harvester Github Release and it will mount the ISO image as a harvester installer to our empty /dev/sdb drive and finally reboots the server. Your ssh terminal should get disconnected and you can close the terminal.

sudo apt update
wget https://releases.rancher.com/harvester/v1.0.2/harvester-v1.0.2-amd64.iso
umount /dev/sdb1
dd bs=1M conv=fdatasync if=./harvester-v1.0.2-amd64.iso of=/dev/sdb
reboot

While the server boots up, click on View Console (right top monitor icon) in vultr management console. Next when seeing the below screen start hitting the F11 key on your keyboard to take you to the boot menu screen.

Vultr Boot Menu

You should see boot menu screen like below. This is the place where you can enter boot setup and change the boot order.

Vultr Boot Menu Options

Select UEFI OS ( P3: Intel SSDSC2BB240G7 ) and press enter. (Basically, it means you are selecting to boot from /dev/sdb drive which has a harvester installer ISO image mounted on it)

Rancher Harvester Installation

Select Harvester Installer v1.0.2 and press enter. It will take a few minutes to boot the kernel and it should show you the below screen.

Rancher Harvester Installation New cluster

Select Create new harvester cluster. You can select join the existing harvester cluster if you already have the harvester cluster up and running. 

Rancher Harvester Installation Partitions

Next, you get the option to choose the drive to install Harvester. We select sda 223.6G. Remember, We have two disk partitions /dev/sda and /dev/sdb. In /dev/sda (this has pre-installed Ubuntu 22.04 LTS OS running on it) and /dev/sdb we have a harvester installer (currently we booted from this). We are going to erase and remove Ubuntu OS from /dev/sda and install Harvester v1.0.4 in /dev/sda.

Rancher Harvester Installation Configuration

Enter the hostname and select Management NIC. You can also select Bond Mode and IPv4 method. I will leave it with default values. Press enter to continue. It will apply the network configurations.

Rancher Harvester Installation Configuration

It will ask for configuring DNS servers. I will leave it empty and press enter. (Optional step)

Rancher Harvester Installation Configuration

Next, it will ask for configuring Virtual Private IP. I am giving it as a static method and 172.168.0.102. This is an important and mandatory step and make sure this is done right. The VIP IP address you can use anything that you want to use to expose your application. 

Rancher Harvester Installation Configuration

Enter your cluster token, this will be used when you are joining the existing harvester cluster.

Rancher Harvester Installation Configuration

Enter the password and confirm the password. Press enter to continue.

Rancher Harvester Installation Configuration

Configuring NTP server. Use the default value and press enter.

Rancher Harvester Installation Configuration

Configuring Proxy. Leave it empty and press enter. 

Rancher Harvester Installation Configuration

Configuring SSH/import SSH key. You can import it if you have one or leave it empty and press enter.

Rancher Harvester Installation Configuration

Harvester remote configuration - You can add it if you have one or leave it empty and press enter.

Rancher Harvester Installation Summary


Finally, it gives a summary and it will ask whether you want to erase and install the harvester. Select yes and press enter.

Rancher Harvester Installation


Installation should start. It will show you the installation progress. It will take a couple of minutes to complete the installation and finally, it automatically reboots the server. 

Vultr Boot Menu

When the server boots up, press the F11 key on your keyboard to take you to the boot menu screen and this time we are going to select UEFI OS ( P2: Intel SSDSC2BB240G7 ) and press enter. (Basically, it means you are selecting to boot from /dev/sda drive which has a harvester installed)

Rancher Harvester Boot

Select Harvester v1.0.4 and press enter. You will be taken to the next screen which has the Rancher Harvester Management URL, IP address, and cluster state.  Please be patient, it will initially show cluster state as Unavailable, Not Ready, Setting Up, etc. After giving a couple of minutes it should show you the below screen.

Rancher Harvester Management Console


Congratulations, your Rancher Harvester cluster is Up. You can go to vultr public IP (vultr management console) from the new browser tab and you should be able to setup rancher harvester UCM first-time login screen. Set your new password and click on continue.

Rancher Harvester Login Setup




Rancher Harvester UCM

Wrapping Up

Thanks and congratulations on setting up your new harvester infrastructure. If you encountered any issues while setting up the cluster, please comment below. I have covered only the single node harvester setup process and will cover how to join existing harvester nodes to form a harvester cluster, Virtual Machine deployment, and Virtual Machine migration to a new harvester host/node in my upcoming posts. So stay tuned and happy developing infrastructure.  

0 comments:

Post a Comment