kubevirt
KubeVirt - Virtual Machine Management on Kubernetes - Deploy and manage VMs as native Kubernetes resources
About this chart
kubevirt
KubeVirt - Virtual Machine Management on Kubernetes - Deploy and manage VMs as native Kubernetes resources
Homepage: https://github.com/encircle360-oss/helm-charts/tree/main/charts/kubevirt
⚠️ UNDER CONSTRUCTION This chart is currently under active development and has not been battle-tested in production environments. NOT PRODUCTION READY - Use at your own risk and thoroughly test in non-production environments first. KubeVirt is a complex system requiring deep Kubernetes and virtualization knowledge. Only use this chart if you are an experienced Kubernetes operator.
Description
KubeVirt is a Kubernetes add-on that enables you to run and manage virtual machines alongside container workloads. This Helm chart provides a deployment of KubeVirt v1.7.0 with comprehensive configuration options.
Key Features:
- Full KubeVirt v1.7.0 support with all feature gates
- Operator-based lifecycle management
- Comprehensive RBAC configuration
- Monitoring integration (ServiceMonitor & PrometheusRule)
- High availability configuration
- Extensive configuration options
Prerequisites
- Kubernetes 1.32+ (vanilla Kubernetes, K3s, K0s, or OpenShift)
- Helm 3.8+
- Nodes with KVM support (hardware virtualization) OR software emulation enabled
- Sufficient cluster resources for VM workloads
Platform Compatibility: This chart works on both vanilla Kubernetes (including K3s, K0s) and OpenShift. OpenShift-specific RBAC rules are included but will be safely ignored on non-OpenShift clusters.
Check Node Virtualization Support:
# Check if nodes have KVM support
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.allocatable.devices\.kubevirt\.io/kvm}{"\n"}{end}'
# Verify KVM is available on nodes
kubectl debug node/<node-name> -it --image=ubuntu -- bash
apt update && apt install -y cpu-checker
kvm-ok
Installation
Quick Start
# Add the Helm repository
helm repo add encircle360-oss https://encircle360-oss.github.io/helm-charts
helm repo update
# Install KubeVirt
helm install kubevirt encircle360-oss/kubevirt \
--namespace kubevirt \
--create-namespace
# Wait for KubeVirt to be ready
kubectl wait kubevirt kubevirt -n kubevirt \
--for=condition=Available \
--timeout=10m
Installation with Custom Values
helm install kubevirt encircle360-oss/kubevirt \
--namespace kubevirt \
--create-namespace \
-f custom-values.yaml
Install with Monitoring
# values-monitoring.yaml
monitoring:
enabled: true
namespace: monitoring
serviceAccount: prometheus-k8s
prometheusRule:
enabled: true
labels:
prometheus: kube-prometheus
helm install kubevirt encircle360-oss/kubevirt \
-f values-monitoring.yaml \
--namespace kubevirt \
--create-namespace
Configuration
Basic Configuration
| Parameter | Description | Default |
|---|---|---|
global.enabled | Enable KubeVirt deployment | true |
namespace.name | Namespace for KubeVirt | kubevirt |
namespace.create | Create the namespace | true |
operator.replicas | Number of operator replicas | 2 |
operator.image.tag | Operator image tag | v1.7.0 |
Feature Gates
KubeVirt uses feature gates to control optional functionality. Feature gates are categorized as:
- Alpha: Experimental features that must be explicitly enabled
- Beta: Features that are stable but may have limitations
- GA: Stable features (enabled by default, no gate needed)
Alpha/Beta Feature Gates (v1.7.0)
kubevirt:
configuration:
developerConfiguration:
featureGates:
# Storage
- ExpandDisks # Dynamic disk expansion
- HostDisk # Host disk access
- ImageVolume # Image volume support (Beta in v1.7.0)
# Performance
- CPUManager # CPU pinning and NUMA topology
- AlignCPUs # Align guest and host CPU topology
# Hardware
- HostDevices # PCI device passthrough
- GPUsWithDRA # GPU with Dynamic Resource Allocation
- HostDevicesWithDRA # Host devices with DRA
# Security
- WorkloadEncryptionSEV # AMD SEV memory encryption
- KubevirtSeccompProfile # Custom seccomp profiles
- SecureExecution # IBM Secure Execution
# Networking
- VSOCK # AF_VSOCK for host-guest communication
- PasstIPStackMigration # PASST IP stack migration
# Other
- ExperimentalIgnitionSupport # Ignition config support
- HypervStrictCheck # Strict Hyper-V feature checking
- Sidecar # Sidecar container injection
- DownwardMetrics # Expose metrics to VMs
- Root # Run virt-launcher as root
- DisableMDEVConfiguration # Disable automatic MDEV configuration
- PersistentReservation # SCSI persistent reservations
- MultiArchitecture # Multi-architecture support
- VirtIOFSConfigVolumesGate # VirtioFS for config volumes
- VirtIOFSStorageVolumeGate # VirtioFS for storage volumes
- DecentralizedLiveMigration # Decentralized live migration
- ObjectGraph # Object graph feature
- DeclarativeHotplugVolumes # Declarative hotplug volumes
- VideoConfig # Video device configuration
- PanicDevices # Panic device support
GA Feature Gates (No Configuration Needed)
The following features are stable and enabled by default in v1.7.0. You do NOT need to specify these in feature gates:
LiveMigration- Live migration of VMsSRIOVLiveMigration- Live migration with SR-IOVNonRoot- Run as non-root userPSA- Pod Security AdmissionCPUNodeDiscovery- CPU node discoveryNUMA- NUMA topology supportGPU- GPU passthroughVMLiveUpdateFeatures- Live update VM features (GA in v1.5.0)CommonInstancetypesDeploymentGate- Common instance types (GA in v1.4.0)HotplugNICs- Hot-plug network interfaces (GA in v1.4.0)BochsDisplayForEFIGuests- Bochs display for EFI (GA in v1.4.0)AutoResourceLimitsGate- Automatic resource limits (GA in v1.5.0)NetworkBindingPlugins- Network binding plugins (GA in v1.5.0)DynamicPodInterfaceNaming- Dynamic pod interface naming (GA in v1.5.0)VolumesUpdateStrategy- Volumes update strategy (GA in v1.5.0)VolumeMigration- Volume migration (GA in v1.5.0)InstancetypeReferencePolicy- Instance type reference policy (GA in v1.6.0)Snapshot- VM snapshot support (GA in v1.7.0)VMExport- VM export functionality (GA in v1.7.0)HotplugVolumes- Hot-plug/unplug volumes (GA in v1.7.0)NodeRestriction- Node restriction (GA in v1.7.0)
CPU Configuration
kubevirt:
configuration:
# Default CPU model for VMs
cpuModel: "host-passthrough"
# Default CPU request
cpuRequest: "100m"
# Mark obsolete CPUs as unusable
obsoleteCPUModels:
pentium: true
pentium2: true
pentium3: true
Conroe: true
Penryn: true
Network Configuration
kubevirt:
configuration:
network:
# Default network interface type
defaultNetworkInterface: "masquerade"
# Allow bridge on pod network
permitBridgeInterfaceOnPodNetwork: false
# Allow SLIRP interface
permitSlirpInterface: false
Live Migration Configuration
kubevirt:
configuration:
migration:
# Disable TLS (not recommended for production)
disableTLS: false
# Allow auto-converge for slow migrations
allowAutoConverge: false
# Bandwidth limit per migration
bandwidthPerGiB: "64Mi"
# Timeouts
completionTimeoutPerGiB: 800
progressTimeout: 150
# Parallelism
parallelMigrationsPerCluster: 5
parallelOutboundMigrationsPerNode: 2
# Post-copy migration (use with caution)
allowPostCopy: false
# Dedicated migration network
network: ""
Storage Configuration
kubevirt:
configuration:
# Storage class for VM snapshots and state
vmStateStorageClass: "standard"
Host Device Passthrough
kubevirt:
configuration:
permittedHostDevices:
# PCI devices
pciHostDevices:
- pciVendorSelector: "10DE:1EB8" # NVIDIA Tesla T4
resourceName: "nvidia.com/T4"
- pciVendorSelector: "8086:1572" # Intel X710
resourceName: "intel.com/X710"
# Mediated devices (vGPU)
mediatedDevices:
- mdevNameSelector: "GRID T4-1Q"
resourceName: "nvidia.com/GRID_T4-1Q"
Node Placement
Infrastructure Components (virt-api, virt-controller)
kubevirt:
infra:
nodePlacement:
nodeSelector:
node-role.kubernetes.io/control-plane: ""
tolerations:
- key: node-role.kubernetes.io/control-plane
effect: NoSchedule
Workload Components (virt-handler, virt-launcher)
kubevirt:
workloads:
nodePlacement:
nodeSelector:
kubevirt.io/vm-workload: "true"
tolerations:
- key: kubevirt.io/vm-workload
effect: NoSchedule
Monitoring Configuration
monitoring:
enabled: true
namespace: monitoring
serviceAccount: prometheus-k8s
serviceMonitorLabels:
prometheus: kube-prometheus
scrapeInterval: "30s"
prometheusRule:
enabled: true
labels:
prometheus: kube-prometheus
# Add custom alerting rules
additionalRules:
- alert: MyCustomAlert
expr: up == 0
for: 5m
labels:
severity: critical
Usage Examples
Creating a Virtual Machine
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: ubuntu-vm
spec:
running: true
template:
metadata:
labels:
kubevirt.io/vm: ubuntu-vm
spec:
domain:
devices:
disks:
- name: containerdisk
disk:
bus: virtio
- name: cloudinitdisk
disk:
bus: virtio
resources:
requests:
memory: 2Gi
cpu: 2
volumes:
- name: containerdisk
containerDisk:
image: quay.io/containerdisks/ubuntu:22.04
- name: cloudinitdisk
cloudInitNoCloud:
userData: |
#cloud-config
password: ubuntu
chpasswd: { expire: False }
ssh_pwauth: True
Using virtctl
# Install virtctl
kubectl krew install virt
# Start/Stop VMs
kubectl virt start ubuntu-vm
kubectl virt stop ubuntu-vm
kubectl virt restart ubuntu-vm
# Console access
kubectl virt console ubuntu-vm
# VNC access
kubectl virt vnc ubuntu-vm
# SSH into VM (requires SSH service in VM)
kubectl virt ssh ubuntu@ubuntu-vm
VM Snapshots (requires Snapshot feature gate)
# Enable snapshot feature
kubevirt:
configuration:
developerConfiguration:
featureGates:
- Snapshot
# Create snapshot
apiVersion: snapshot.kubevirt.io/v1alpha1
kind: VirtualMachineSnapshot
metadata:
name: ubuntu-vm-snapshot
spec:
source:
apiGroup: kubevirt.io
kind: VirtualMachine
name: ubuntu-vm
Upgrading
Upgrade the Chart
helm repo update
helm upgrade kubevirt encircle360-oss/kubevirt \
--namespace kubevirt \
-f values.yaml
Upgrade Strategy
KubeVirt supports rolling updates of VMs during upgrades:
kubevirt:
workloadUpdateStrategy:
workloadUpdateMethods:
- LiveMigrate # Try live migration first
- Evict # Fall back to eviction
batchEvictionSize: 10
batchEvictionInterval: "1m"
Frequently Asked Questions (FAQ)
Does this work on K3s/K0s/vanilla Kubernetes?
Yes! This chart is designed to work on:
- Vanilla Kubernetes (upstream)
- K3s (lightweight Kubernetes)
- K0s (zero friction Kubernetes)
- MicroK8s
- OpenShift/OKD
The chart includes OpenShift-specific RBAC rules, but these are safely ignored on non-OpenShift clusters.
Why are there OpenShift resources in the RBAC?
KubeVirt officially supports both vanilla Kubernetes and OpenShift. The OpenShift-specific resources (security.openshift.io/securitycontextconstraints, route.openshift.io/routes) are:
- Optional and only used on OpenShift
- Ignored on vanilla Kubernetes/K3s (API groups don't exist)
- Standard practice in the official KubeVirt manifests
Your K3s cluster will simply skip these rules - no issues!
Why do some labels have empty values like operator.kubevirt.io: ""?
This is valid and intentional in Kubernetes! Empty-string label values are used as:
- Marker labels: Indicate that something is tagged without needing a specific value
- Selector labels: Can be matched with
matchLabels: { "operator.kubevirt.io": "" } - KubeVirt convention: How KubeVirt identifies its own resources internally
Do I need hardware virtualization (KVM)?
Recommended but not required:
- With KVM (hardware virtualization): Full performance VMs
- Without KVM (software emulation): Slower VMs using QEMU emulation
Enable software emulation if nodes lack KVM:
kubevirt:
configuration:
developerConfiguration:
useEmulation: true
Can I run this on ARM64 nodes?
Yes, with limitations. Enable the `MultiArchitect
Deploy kubevirt with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kubevirt on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartkubevirt is pinned at v0.2.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply