Deploying a Virtual Machine in Kubernetes(!)

tjtharrison
10 min readJan 11, 2024

If you have been following my stories recently, I am training for my Kubernetes exams so have provisioned a self-hosted Kubernetes cluster of 4 (previously 3..) Kubernetes nodes running on some small form factor PCs (Setting up Homelab 3.0).

Recently, I had a requirement to run a few servers for a personal project I was working on (setting up an ELK cluster to POC Kibana security plugins — Article to follow soon!) so started looking into options for running some virtualisation tooling alongside Kubernetes to run a virtual machine but quickly came across the project kubevirt.

Kubevirt allows you to provision virtual machines in Kubernetes, with machines configured as code and deployed into your cluster using CRDs (Custom Resource Definitions) with the Kubevirt operator (super cool!).

Only a few years ago when I was working as a sysadmin, we used to run Kubernetes on Virtual machines on our self hosted hypervisors — It’s wild that this is completely reversed now and we’re running virtual machines on Kubernetes!

This article will cover how to get kubevirt deployed onto your Kubernetes cluster and get your first VM deployed.

Photo by Shubham Dhage on Unsplash

Prerequisites:

  • A working Kubernetes cluster
  • Helm client installed locally

--

--