Documentation ¶
Index ¶
- Constants
- func CPUFeatureLabelsFromCPUFeatures(vmi *v1.VirtualMachineInstance) []string
- func CPUModelLabelFromCPUModel(vmi *v1.VirtualMachineInstance) (label string, err error)
- func GetMemoryOverhead(vmi *v1.VirtualMachineInstance, cpuArch string) *resource.Quantity
- func HaveContainerDiskVolume(volumes []v1.Volume) bool
- func HaveMasqueradeInterface(interfaces []v1.Interface) bool
- func SetNodeAffinityForForbiddenFeaturePolicy(vmi *v1.VirtualMachineInstance, pod *k8sv1.Pod)
- type DataVolumeNotFoundError
- type PvcNotFoundError
- type TemplateService
Constants ¶
const ( CAP_NET_BIND_SERVICE = "NET_BIND_SERVICE" CAP_NET_RAW = "NET_RAW" CAP_SYS_ADMIN = "SYS_ADMIN" CAP_SYS_NICE = "SYS_NICE" CAP_SYS_PTRACE = "SYS_PTRACE" )
const ( VirtLauncherMonitorOverhead = "25Mi" // The `ps` RSS for virt-launcher-monitor VirtLauncherOverhead = "75Mi" // The `ps` RSS for the virt-launcher process VirtlogdOverhead = "16Mi" // The `ps` RSS for virtlogd LibvirtdOverhead = "33Mi" // The `ps` RSS for libvirtd QemuOverhead = "30Mi" // The `ps` RSS for qemu, minus the RAM of its (stressed) guest, minus the virtual page table )
const ENV_VAR_LIBVIRT_DEBUG_LOGS = "LIBVIRT_DEBUG_LOGS"
const ENV_VAR_POD_NAME = "POD_NAME"
const ENV_VAR_VIRTIOFSD_DEBUG_LOGS = "VIRTIOFSD_DEBUG_LOGS"
const ENV_VAR_VIRT_LAUNCHER_LOG_VERBOSITY = "VIRT_LAUNCHER_LOG_VERBOSITY"
const EXT_LOG_VERBOSITY_THRESHOLD = 5
extensive log verbosity threshold after which libvirt debug logs will be enabled
const ISTIO_KUBEVIRT_ANNOTATION = "traffic.sidecar.istio.io/kubevirtInterfaces"
Istio list of virtual interfaces whose inbound traffic (from VM) will be treated as outbound traffic in envoy
const IntelVendorName = "Intel"
const KvmDevice = "devices.kubevirt.io/kvm"
const LibvirtStartupDelay = 10
LibvirtStartupDelay is added to custom liveness and readiness probes initial delay value. Libvirt needs roughly 10 seconds to start.
const MULTUS_DEFAULT_NETWORK_CNI_ANNOTATION = "v1.multus-cni.io/default-network"
const MULTUS_RESOURCE_NAME_ANNOTATION = "k8s.v1.cni.cncf.io/resourceName"
const MultusNetworksAnnotation = "k8s.v1.cni.cncf.io/networks"
const NFD_CPU_FEATURE_PREFIX = "cpu-feature.node.kubevirt.io/"
const NFD_CPU_MODEL_PREFIX = "cpu-model.node.kubevirt.io/"
These perfixes for node feature discovery, are used in a NodeSelector on the pod to match a VirtualMachineInstance CPU model(Family) and/or features to nodes that support them.
const NFD_KVM_INFO_PREFIX = "hyperv.node.kubevirt.io/"
const SevDevice = "devices.kubevirt.io/sev"
const TunDevice = "devices.kubevirt.io/tun"
const VELERO_POSTBACKUP_HOOK_COMMAND_ANNOTATION = "post.hook.backup.velero.io/command"
const VELERO_POSTBACKUP_HOOK_CONTAINER_ANNOTATION = "post.hook.backup.velero.io/container"
const VELERO_PREBACKUP_HOOK_COMMAND_ANNOTATION = "pre.hook.backup.velero.io/command"
const VELERO_PREBACKUP_HOOK_CONTAINER_ANNOTATION = "pre.hook.backup.velero.io/container"
const VhostNetDevice = "devices.kubevirt.io/vhost-net"
Variables ¶
This section is empty.
Functions ¶
func CPUFeatureLabelsFromCPUFeatures ¶ added in v0.15.0
func CPUFeatureLabelsFromCPUFeatures(vmi *v1.VirtualMachineInstance) []string
func CPUModelLabelFromCPUModel ¶ added in v0.11.1
func CPUModelLabelFromCPUModel(vmi *v1.VirtualMachineInstance) (label string, err error)
func GetMemoryOverhead ¶ added in v0.47.0
func GetMemoryOverhead(vmi *v1.VirtualMachineInstance, cpuArch string) *resource.Quantity
GetMemoryOverhead computes the estimation of total memory needed for the domain to operate properly. This includes the memory needed for the guest and memory for Qemu and OS overhead.
The return value is overhead memory quantity ¶
Note: This is the best estimation we were able to come up with
and is still not 100% accurate
func HaveContainerDiskVolume ¶ added in v0.36.0
func HaveMasqueradeInterface ¶ added in v0.16.0
func SetNodeAffinityForForbiddenFeaturePolicy ¶ added in v0.15.0
func SetNodeAffinityForForbiddenFeaturePolicy(vmi *v1.VirtualMachineInstance, pod *k8sv1.Pod)
Types ¶
type DataVolumeNotFoundError ¶ added in v0.47.0
type DataVolumeNotFoundError struct {
Reason string
}
func (DataVolumeNotFoundError) Error ¶ added in v0.47.0
func (e DataVolumeNotFoundError) Error() string
type PvcNotFoundError ¶ added in v0.9.0
type PvcNotFoundError struct {
Reason string
}
func (PvcNotFoundError) Error ¶ added in v0.47.0
func (e PvcNotFoundError) Error() string
type TemplateService ¶
type TemplateService interface { RenderMigrationManifest(vmi *v1.VirtualMachineInstance, sourcePod *k8sv1.Pod) (*k8sv1.Pod, error) RenderLaunchManifest(vmi *v1.VirtualMachineInstance) (*k8sv1.Pod, error) RenderHotplugAttachmentPodTemplate(volume []*v1.Volume, ownerPod *k8sv1.Pod, vmi *v1.VirtualMachineInstance, claimMap map[string]*k8sv1.PersistentVolumeClaim, tempPod bool) (*k8sv1.Pod, error) RenderHotplugAttachmentTriggerPodTemplate(volume *v1.Volume, ownerPod *k8sv1.Pod, vmi *v1.VirtualMachineInstance, pvcName string, isBlock bool, tempPod bool) (*k8sv1.Pod, error) RenderLaunchManifestNoVm(*v1.VirtualMachineInstance) (*k8sv1.Pod, error) GetLauncherImage() string IsPPC64() bool IsARM64() bool }
func NewTemplateService ¶
func NewTemplateService(launcherImage string, launcherQemuTimeout int, virtShareDir string, virtLibDir string, ephemeralDiskDir string, containerDiskDir string, hotplugDiskDir string, imagePullSecret string, persistentVolumeClaimCache cache.Store, virtClient kubecli.KubevirtClient, clusterConfig *virtconfig.ClusterConfig, launcherSubGid int64) TemplateService