Baremetal Kubernetes with Harvester and k3s

liorkesos
Linnovate
Published in
4 min readMar 17, 2021

While many computing workloads are migrating to the cloud, there are many heavily regulated and heavily sensitive verticals like finance, healthcare and defense that need to run on physical hardware.

Historically it was very expensive or complicated to set up enterprise-grade virtualization on bare-metal hardware.
The options were either using commercial frameworks like vmware, vsphere or esxi or open source virtualization like Xen or openstack.

I took a different approach with a new and young project by Rancher called Harvester.
I’ve worked with OpenStack before and Harvester feels like Rancher’s attempt to rewrite OpenStack in a simpler way with a cloud-native mindset.

The Rancher team integrated the following cloud-native projects …

  • MinIO is a cloud storage server compatible with Amazon S3.
  • Longhorn is a lightweight, reliable, and easy-to-use distributed block storage system for Kubernetes.
  • KubeVirt is a virtual machine management add-on for Kubernetes.
  • K3OS is a Linux distribution designed to remove as much OS maintenance as possible in a Kubernetes cluster. The OS is designed to be managed by kubectl.

So I decided to build a lab from the ground up utilizing old hardware that used to run Xen and ESXi. The first step was to purchase a 15U network rack to place the various hardware we’ve accumulated and that is no longer needed because we moved the workloads running on it to the cloud.

My empty 15U network rack

So the first step was to install a switch and our first server…

Installing harvester

I downloaded a Harvester ISO from here, like the Harvester documentation stated. Once I booted from CD the installation is pretty simple (look at the shift video below to get an idea of how it looks).

Once I set up my first server, I could contact it with the URL stated in the harvester console…

After the dazzling asciiart I am greeted with a nice and homey rancher-themed dashboard….

and when I log in I can see my host registered in the system.

The harvester UI

I can now set up the virtual servers for Rancher ,3 RKE based nodes for the control planes, and another 3 worker nodes.

Setup harvester

Upload Images

The first step is to upload the image you want to use to the images tab.
To do so, I went to the ubuntu site and obtained the exact path to the image I wanted to use as the based image for my vms ( in this case, I used the ubuntu minimal image for focal — ubuntu 20.04 LTS ).

harvester images tab

I created the first rancher VM by going to the tab of the virtual machine and creating my vm for Rancher (based on a single node ) running k3s and Rancher upon it.

After that, I provisioned another 3 nodes for the k8s ctrl plane and can access each one of the nodes with ssh (after adding my ssh key to the SSH key tab )

Our VMS

Installing k3s & Rancher

Once I got the Rancher vms IP, I could now ssh into the new rancher VM and I installed k3s using the super simple installation process …

curl -sfL https://get.k3s.io | sh 

Woot, Now we have k3s running on the server and we can install various apps and Rancher on it!

To receive articles like this one, subscribe here.

Have a specific project that would fit within the confines of this article? Let’s connect and discuss.

--

--

liorkesos
Linnovate

Open source geek with 2 companies , 5 kids and too many ideas