I’ll admit that when I first saw the KubeVirt appear on my radar I thought that someone was pulling my leg… Kubernetes rise in the IT professionals day to day vernacular has resulted in a ton of interest to understand what it is and what it does. It has strong roots with with developer lead application development driving adoption past the mainstream to be the dominate force as a modern application platform.
The reality is that physical and virtual machines will not be going away even with this shift to cloud and containers. In the same way that we now accept hybrid cloud infrastructure as the norm, so to, will it come to pass that Kubernetes driving containerization will live side by side with traditional server infrastructure such as virtualization…
But what if you could have both together… containers and virtual machine controlled by the same management plane… this is were KubeVirt comes into play.
What is KubeVirt?
KubeVirt, started in 2016 and is an open source project distributed under an Apache 2.0 License from 2017. It is a set of controllers (CRDs) which allow a way to run Virtual Machine on Kubernetes. It uses the same native constructs of Kubernetes such as scheduling, storage, networking, monitoring and tooling via kubectl. It was created by Red Hat to enable Kubernetes to provision, manage, and control VMs alongside container resources. It was built as a way to make it easier to move from a virtual infrastructure to a Kubernetes and container based infrastructure, one workload at a time
The beauty and simplicity of KVM virtualization is that virtual machines are Linux processes, benefiting from existing Linux features. Virtualization is mostly used in managed environments, orchestrating virtual machines (compute) across a cluster of hosts, network and storage. Kubernetes is orchestrating containers (processes) across a cluster of hosts, network and storage. With KVM virtual machine being a Linux process, why not use Kubernetes to orchestrate virtual machines?
KubeVirt VMs run within regular Kubernetes pods, where they have access to the standard pod networking and storage. The layers are represented as shown below.
| KubeVirt |
| Orchestration (K8s) |
| Scheduling (K8s) |
| Container Runtime |
| Operating System |
| Virtual(kvm) |
| Physical |
The benefits or KubeVirt should be easy to understand if you know what Kubernetes brings to the containers table. IT Operations with a reliance on existing virtual machine based workloads are empowered to rapidly containerize applications. Virtualized workloads are placed directly in development workflows, which can then be consumed as a Kubernetes deployment, namespace etc which allows them over time to leverage remaining virtualized components as is required.
Users requiring virtualization services are speaking to the Virtualization API (see below) which in turn is speaking to the Kubernetes cluster to schedule requested Virtual Machine Instances (VMIs). Scheduling, networking, and storage are all delegated to Kubernetes, while KubeVirt provides the virtualization functionality. There also is a way to import VMs from different hyper-visor platforms using KVM import techniques.
Running VMs with Kubernetes involves a bit of an adjustment, and clearly a different and steeper learning curve compared to using something like vSphere, oVirt, OpenShift or other virtual platform. This is a whole new world for VM admins, but one that I believe is worth starting to get familiar with as even VMware and other virtualization players have started to go down this path of Kubernetes as the overall control plane. There are also a number of Kubernetes platforms starting to look at how to integrate KubeVirt into their offerings.
Understanding the basic architecture of KubeVirt is a good place to begin and there are a few resources below.