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
Configuration for certificate rotation strategy.
KubeVirt configuration settings, equivalent to the
virt-config ConfigMap.Customization options for KubeVirt components.
Image pull policy for KubeVirt containers:
"Always", "IfNotPresent", or "Never".List of image pull secrets for accessing private container registries.
Container image registry to pull KubeVirt images from. Defaults to the operator’s registry.
Tag for KubeVirt container images. Defaults to the operator’s image tag.
Node selectors and tolerations for KubeVirt infrastructure components.
Prometheus service account name for monitoring KubeVirt endpoints. Defaults to
"prometheus-k8s".Namespace where Prometheus is deployed. Defaults to
"openshift-monitor".Value for the
apps.kubevirt.io/component label. Defaults to "kubevirt" if not specified.Value for the
apps.kubevirt.io/part-of label. Useful when KubeVirt is part of a larger product.Value for the
apps.kubevirt.io/version label. Defaults to KubeVirt’s version if not specified.Namespace for deploying ServiceMonitor objects. If not set, uses
monitor_namespace.Controls whether KubeVirt can be deleted when workloads are present. Prevents accidental data loss.
Cluster-wide strategy for handling automated workload updates.
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.