Overview
TheKubeVirt class represents the primary resource for deploying and configuring the KubeVirt virtualization platform in an OpenShift cluster. It manages all KubeVirt infrastructure components and provides cluster-wide virtualization configuration.
Class Definition
Constructor
dict
Configuration for certificate rotation strategy.
dict
KubeVirt configuration settings, equivalent to the
virt-config ConfigMap.dict
Customization options for KubeVirt components.
string
Image pull policy for KubeVirt containers:
"Always", "IfNotPresent", or "Never".list
List of image pull secrets for accessing private container registries.
string
Container image registry to pull KubeVirt images from. Defaults to the operator’s registry.
string
Tag for KubeVirt container images. Defaults to the operator’s image tag.
dict
Node selectors and tolerations for KubeVirt infrastructure components.
string
Prometheus service account name for monitoring KubeVirt endpoints. Defaults to
"prometheus-k8s".string
Namespace where Prometheus is deployed. Defaults to
"openshift-monitor".string
Value for the
apps.kubevirt.io/component label. Defaults to "kubevirt" if not specified.string
Value for the
apps.kubevirt.io/part-of label. Useful when KubeVirt is part of a larger product.string
Value for the
apps.kubevirt.io/version label. Defaults to KubeVirt’s version if not specified.string
Namespace for deploying ServiceMonitor objects. If not set, uses
monitor_namespace.string
Controls whether KubeVirt can be deleted when workloads are present. Prevents accidental data loss.
dict
Cluster-wide strategy for handling automated workload updates.
dict
Node selectors and tolerations that apply to KubeVirt workload pods (VMs).
Usage Examples
Configuration Options
Feature Gates
Common feature gates that can be enabled in theconfiguration parameter:
LiveMigration: Enable live migration of VMs between nodesHotplugVolumes: Allow hotplugging of volumes to running VMsCPUManager: Enable CPU manager integrationGPU: Enable GPU passthrough supportHostDevices: Enable host device passthroughSnapshot: Enable VM snapshot supportHotplugNICs: Allow hotplugging of network interfaces
Network Configuration
Network-related configuration options:Developer Configuration
Developer and debugging options:Status Conditions
The KubeVirt resource reports the following conditions:Available: All KubeVirt components are readyProgressing: KubeVirt is being deployed or updatedDegraded: One or more components are not functioning properly
Related Resources
VirtualMachine
Create and manage virtual machines
DataVolume
Manage persistent storage for VMs
Notes
The KubeVirt resource is typically deployed by the OpenShift Virtualization operator. Manual creation is only needed for custom deployments or advanced configurations.