Configs2026年4月15日·1 分钟阅读

KubeVirt — Run Virtual Machines on Kubernetes

KubeVirt extends Kubernetes with VM-native workloads. It lets you declare, schedule and manage traditional virtual machines as first-class Kubernetes objects alongside containers, sharing the same networking and storage.

Introduction

KubeVirt is a CNCF incubating project that turns every Kubernetes node into a hypervisor host via the Linux kernel KVM stack. Instead of running two platforms — one for containers, one for VMs — operators can manage stateful legacy workloads and modern cloud-native services using the same scheduling, networking and storage primitives.

What KubeVirt Does

  • Introduces VirtualMachine, VirtualMachineInstance and VirtualMachineInstancePreset CRDs
  • Runs each VM inside a Pod via virt-launcher + libvirt + qemu-kvm
  • Integrates with CNI for L2/L3 networking and with CSI for persistent storage
  • Enables live migration, snapshots, cloning and HotPlug devices
  • Ships companion tools (CDI, HCO, Forklift, MTV) for imports and data management

Architecture Overview

A KubeVirt install includes an operator that manages several DaemonSets/Deployments: virt-api (admission and API), virt-controller (VM lifecycle), virt-handler (per-node agent) and virt-launcher (Pod wrapper for a VM). The handler programs the kernel through libvirt; the launcher runs a single qemu-kvm process per VM. CDI (Containerized Data Importer) manages disk images in PVCs, and the virtctl CLI covers console, VNC and live migration.

Self-Hosting & Configuration

  • Install via operator manifests or the Hyperconverged Cluster Operator (HCO) for batteries-included setups
  • Node requirements: KVM-enabled CPU, nested virtualisation enabled if running in a cloud VM
  • Use MultusCNI for VLAN-aware VM networking
  • Use CDI to import qcow2/ISO images from HTTP, S3 or container registries
  • Configure Storage Profiles to pick the right CSI snapshot/clone strategy per StorageClass

Key Features

  • First-class Kubernetes CRDs for VMs, with familiar kubectl workflows
  • Live migration between nodes for maintenance and rebalancing
  • HotPlug CPU, memory, disks and NICs
  • Integrated with Multus, Calico, Cilium and SR-IOV for advanced networking
  • Backed by a rich ecosystem (CDI, KubeSAN, Forklift) for VM migrations from oVirt/VMware

Comparison with Similar Tools

  • Proxmox / vSphere — dedicated hypervisors; KubeVirt unifies them with Kubernetes control
  • OpenStack Nova — heavyweight VM platform; KubeVirt sits on top of Kubernetes primitives
  • Firecracker — microVM focus for serverless; KubeVirt targets general-purpose VMs
  • kata-containers — runs pods in VMs; KubeVirt exposes VMs themselves
  • virt-manager / libvirt alone — great for single hosts, KubeVirt clusters them

FAQ

Q: Can I run Windows workloads? A: Yes. KubeVirt includes drivers and documentation for Windows guests, including VirtIO drivers and device passthrough.

Q: Does live migration work without shared storage? A: Requires a ReadWriteMany volume or block-level replication for most storage classes; local storage can use storage-live-migration with CDI.

Q: How much overhead does virt-launcher add? A: A few hundred MB per VM plus the qemu-kvm footprint. KVM itself runs near bare-metal speeds.

Q: Is it production ready? A: Yes, it is used in production by Red Hat OpenShift Virtualization and many Kubernetes platforms.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产