Overview of Virtlet and KubeVirt
Virtlet and KubeVirt both address the needs of almost every development teams who have or wants to adopt Kubernetes but still possess existing virtual machine based workloads which can’t be easily containerized. They provide a unified platform where developers can build, modify and deploy applications in both containers and virtual machines in a shared environment using open source hypervisors and tools like KVM, libvirt and qemu. But there are some differences in the usability and working of both virtlet and kubelet.
Virtlet and KubeVirt Working Architecture
Virtlet is a Container Runtime Interface (CRI) implementation as all the virtual machines are defined as Kubernetes pods. It provides support for common kubectl commands, such as create, apply, get, delete, logs, attach and port-forward. The virtual machine acts as pod meaning Kubernetes sees virtual machine same way it considers Docker containers.
KubeVirt uses an addon Kubernetes Custom Resource definitions for provisioning of the virtual machines on Kubernetes. The virtual machines run within regular Kubernetes pods, where they have access to pod networking and storage. Virtual machines can’t be used as part of deployments, and demon sets they have to reimplement replica sets as Virtual Machine Replicaset.
Why Adopting Virtlet and KubeVirt matters?
In recent years containers have dominated the computer world. Organizations are moving to microservices architecture because of scalability and flexibility, but organizations are bound to existing applications which are not easy to run in containers and requires particular kernel tuning configurations to run them efficiently, e.g. databases or IIS. Running virtual machines separately from containers means additional infrastructure and operations cost. Virtlet and KubeVirt both provides an alternate solution to keep using the existing Kubernetes infrastructure with the ability to run non-containerized applications in virtual machines parallel to containerized applications.
How to Adopt Virtlet and KubeVirt?
Adopting either of KubeVirt or virtlet depends on the use-case. For starting, we need Kubernetes cluster on the server which supports virtualization, not a hard requirement; otherwise, the qemu can be used instead of KVM hypervisor, but the performance will be much slower. Virtlet project is an open source project and is managed by migrants they are focusing mainly on easy usability and networking features like SRIOV for 5G & NFV use case. KubeVirt is also an open source project lead by the Kubernetes community itself. They are focusing mainly on providing flexibility across the platform for storage and networking so that it can be easily pluggable with any technology.
Comparing Features of Virtlet and KubeVirt
|Able to run virtual machines and Containers on the same node||Yes||Yes|
|SR-IOV support||No Future Road Map||Yes|
|Usability i k8s objects like DaemonSet, ReplicaSet, Deployment?||No||Yes|
|Support for readinessProbe||No||Yes|
|Support for livenessProbe||No||Yes|
|Support for multiple interfaces||No||Yes|
|Access console||Yes (by external to kubectl command)||Yes (by using kubectl command)|
|Exposing virtual machines via a Service||Yes||Yes|
|Access graphical consoles||Yes (by external to kubectl command)||Yes (by using kubectl command)|
|Support for virtual machines migrations||No||No|
|Support for taints and tolerations||No||Yes|
|Supported Volumes types||flexVolumes|
Virtlet and KubeVirt Best Practices
- Use of hardware supporting virtualization flag like vmx or it for Intel and SVM for AMD processors.
- The latest version of the Kubernetes release.
- Use of NUMA pinning.
Concluding Virtlet and KubeVirt
Virtlet and KubeVirt both technologies provide similar functionality but different feature and usability, Virtlet is a project of mirantis with a smaller community as compared to KubeVirt. KubeVirt still in alpha stage but they are progressing fast covering the features like SR-IOV. Virtlet is easier to use in terms of usability with a smaller learning curve as compared to KubeVirt but bound to kubelet for features. You can also explore the difference between Sql vs NoSql vs NewSql in this insight.