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.
Installation agent prête
Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.
npx -y tokrepo@latest install 494fe800-38e7-11f1-9bc6-00163e2b0d79 --target codexÀ exécuter après confirmation du plan en dry-run.
What it is
KubeVirt is a Kubernetes extension that adds virtual machine workloads as first-class citizens to your cluster. Instead of choosing between containers and VMs, KubeVirt lets you run both side by side, sharing the same networking, storage, and scheduling infrastructure.
The project targets platform engineers managing hybrid workloads where some applications cannot be containerized yet. Legacy Windows apps, licensed software tied to specific OS images, and workloads requiring full kernel access are common use cases.
How it saves time or tokens
Without KubeVirt, teams maintain separate infrastructure stacks for containers and VMs, doubling operational overhead. KubeVirt eliminates this split by letting you define VMs with the same kubectl commands and YAML manifests you already use for pods. One API, one control plane, one set of RBAC policies. Migration from standalone VMware or KVM setups becomes incremental rather than a big-bang rewrite.
How to use
- Install the KubeVirt operator and custom resource on your cluster:
export VERSION=v1.3.0
kubectl apply -f https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/kubevirt-operator.yaml
kubectl apply -f https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/kubevirt-cr.yaml
- Create a VirtualMachine manifest and apply it:
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: demo
spec:
running: true
template:
spec:
domain:
devices:
disks:
- name: disk0
disk:
bus: virtio
resources:
requests:
memory: 512Mi
- Access the VM console with
virtctl console demo.
Example
# List running VMs
kubectl get vmi
# SSH into a VM via virtctl
virtctl ssh user@demo
# Live migrate a VM to another node
virtctl migrate demo
# Stop a VM
virtctl stop demo
Related on TokRepo
- AI Tools for DevOps — more infrastructure automation tools for Kubernetes environments
- Automation Tools — scripts and workflows for infrastructure management
Common pitfalls
- KubeVirt requires hardware virtualization support (Intel VT-x or AMD-V) on worker nodes; nested virtualization in cloud VMs adds latency
- VM images stored as PVCs can be large; plan storage capacity and use CDI (Containerized Data Importer) for efficient image management
- Network policies that work for pods may not cover VM traffic correctly; test VM-to-pod connectivity explicitly after setup
Questions fréquentes
KubeVirt does not replace the hypervisor layer. It uses libvirt and QEMU under the hood, running on top of KVM. What it replaces is the separate management plane. Instead of managing VMs through vCenter or virsh, you manage them through the Kubernetes API with kubectl and standard manifests.
Yes. KubeVirt supports live migration using the virtctl migrate command. The VM moves to another node without downtime, provided shared storage is configured and both nodes have compatible CPU features.
KubeVirt VMs use Kubernetes PersistentVolumeClaims for disk storage. Any CSI-compliant storage provider works, including Ceph, Longhorn, local-path, and cloud provider block storage. The Containerized Data Importer (CDI) handles importing disk images into PVCs.
By default, VMs connect to the same pod network as containers using a bridge or masquerade binding. For advanced use cases like SR-IOV passthrough or multiple NICs, Multus CNI can be configured to attach VMs to additional networks.
KubeVirt is a CNCF incubating project used in production by organizations running hybrid container-VM workloads. Red Hat OpenShift Virtualization is built on KubeVirt, which provides commercial support and validation at scale.
Sources citées (3)
- KubeVirt GitHub— KubeVirt extends Kubernetes with VM workloads
- CNCF Landscape— CNCF incubating project status
- KubeVirt Documentation— KubeVirt architecture and concepts
En lien sur TokRepo
Fil de discussion
Actifs similaires
Virtual Kubelet — Run Kubernetes Pods on Serverless and External Backends
Virtual Kubelet implements the Kubernetes kubelet interface as a pluggable provider, allowing pods to be scheduled onto serverless platforms, IoT edge nodes, or any non-traditional compute backend.
vCluster — Virtual Kubernetes Clusters Inside Real Clusters
vCluster creates lightweight virtual Kubernetes clusters that run inside namespaces of a host cluster, giving teams isolated environments without the cost and complexity of separate physical clusters.
Lima — Linux Virtual Machines for Container Development
Run Linux VMs on macOS and Linux with automatic file sharing, port forwarding, and containerd integration for seamless container workflows.
kind — Run Local Kubernetes Clusters in Docker
Spin up full multi-node Kubernetes clusters inside Docker containers in seconds. kind is SIG Testing's tool — the same way Kubernetes itself runs conformance tests.