How kubevirt/kubevirt works
KubeVirt extends Kubernetes with VM custom resources and cluster controllers and agents that reconcile them into running virtual machines. The documented user flow is declarative VM creation, scheduling, launch, stop, and deletion. The graph includes API admission, controller reconciliation, node handling, the launcher, and notable storage, migration, and device-management capabilities. Relationships are limited to README statements and source-index references or excerpts; several unsampled subsystems are represented by their exact tree paths, with uncertain wiring omitted.
Main entry points: application.go VM controller · controller.go Node handler · manager.go VM launcher · api.go VM resources
Components 19
API and configuration
- VM resources
pkg/virt-api/api.go - Admission webhooks
pkg/virt-api/webhooks/validating-webhook/validating-webhook.go
Cluster control
- Cluster operator
pkg/virt-operator/application.go - VM controller
pkg/virt-controller/watch/application.go - Instance types
pkg/instancetype/controller/vm/controller.go - Storage reconciliation
pkg/virt-controller/watch/vmi/storage.go
Node runtime
- Node handler
pkg/virt-handler/controller.go - Device manager
pkg/virt-handler/device-manager/device_controller.go - VM launcher
pkg/virt-launcher/virtwrap/manager.go - Hook manager
pkg/hooks/manager.go
VM capabilities
- Storage backend
pkg/storage/backend-storage/backend-storage.go - Hotplug validation
pkg/storage/admitters/storagehotplug.go - Migration synchronization
pkg/synchronization-controller/synchronization-controller.go - Migration service
cmd/synchronization-controller/synchronization-controller.go - Network configuration
pkg/network/setup/launcher/configurator.go
Operations
- Monitoring metrics
pkg/monitoring/metrics/virt-handler/domainstats/collector.go - Certificate management
pkg/certificates/bootstrap/cert-manager.go
Other components
- VM user
- Kubernetes API
Connections 19
- VM user → Kubernetes API: declares VM
- Kubernetes API → VM resources: manages resources
- VM resources → Admission webhooks
- Cluster operator → Certificate management: uses certificates
pkg/virt-operator/application.go - VM controller → Hook manager: configures hooks
pkg/virt-controller/watch/application.go - VM controller → Storage reconciliation: registers storage watch
pkg/virt-controller/watch/application.go - Storage reconciliation → Storage backend: calls storage backend
pkg/virt-controller/watch/vmi/storage.go - Instance types → VM controller
- Node handler → VM launcher: uses launcher client
pkg/virt-handler/controller.go - Device manager → Node handler
- VM launcher → Hook manager: uses hook manager
pkg/virt-launcher/virtwrap/manager.go - VM launcher → Network configuration: uses network manager
pkg/virt-launcher/virtwrap/manager.go - Migration service → Migration synchronization: runs controller
cmd/synchronization-controller/synchronization-controller.go - Migration synchronization → Storage backend: uses storage backend
pkg/storage/backend-storage/backend-storage.go - Node handler → Monitoring metrics
- VM controller → Kubernetes API: schedules VMs
- VM controller → Node handler: coordinates launch
- Node handler → VM launcher: launches VM
- Hotplug validation → Admission webhooks