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 PathForNVram(vmi *v1.VirtualMachineInstance) string
- func PathForSwtpm(vmi *v1.VirtualMachineInstance) string
- func PathForSwtpmLocalca(vmi *v1.VirtualMachineInstance) string
- func WithAnnotationsGenerators(generators ...annotationsGenerator) templateServiceOption
- func WithNetBindingPluginMemoryCalculator(netBindingPluginMemoryCalculator netBindingPluginMemoryCalculator) templateServiceOption
- func WithNetTargetAnnotationsGenerator(generator targetAnnotationsGenerator) templateServiceOption
- func WithSidecarCreator(sidecarCreator SidecarCreatorFunc) templateServiceOption
- type ContainerSpecRenderer
- type NodeSelectorRenderer
- type NodeSelectorRendererOption
- type Option
- func WithArgs(args []string) Option
- func WithCapabilities(vmi *v1.VirtualMachineInstance) Option
- func WithDropALLCapabilities() Option
- func WithLivelinessProbe(vmi *v1.VirtualMachineInstance) Option
- func WithNoCapabilities() Option
- func WithNonRoot(userID int64) Option
- func WithPorts(vmi *v1.VirtualMachineInstance) Option
- func WithPrivileged() Option
- func WithReadinessProbe(vmi *v1.VirtualMachineInstance) Option
- func WithResourceRequirements(resources k8sv1.ResourceRequirements) Option
- func WithVolumeDevices(devices ...k8sv1.VolumeDevice) Option
- func WithVolumeMounts(mounts ...k8sv1.VolumeMount) Option
- type ResourceRenderer
- type ResourceRendererOption
- func WithAutoMemoryLimits(namespace string, namespaceStore cache.Store) ResourceRendererOption
- func WithCPUPinning(cpu *v1.CPU, annotations map[string]string) ResourceRendererOption
- func WithEphemeralStorageRequest() ResourceRendererOption
- func WithGPUs(gpus []v1.GPU) ResourceRendererOption
- func WithHostDevices(hostDevices []v1.HostDevice) ResourceRendererOption
- func WithHugePages(vmMemory *v1.Memory, memoryOverhead resource.Quantity) ResourceRendererOption
- func WithMemoryOverhead(guestResourceSpec v1.ResourceRequirements, memoryOverhead resource.Quantity) ResourceRendererOption
- func WithNetworkResources(networkToResourceMap map[string]string) ResourceRendererOption
- func WithPersistentReservation() ResourceRendererOption
- func WithSEV() ResourceRendererOption
- func WithVirtualizationResources(virtResources k8sv1.ResourceList) ResourceRendererOption
- func WithoutDedicatedCPU(cpu *v1.CPU, cpuAllocationRatio int, withCPULimits bool) ResourceRendererOption
- type SidecarCreatorFunc
- type TemplateService
- type VMIResourcePredicates
- type VMIResourceRule
- type VolumeRenderer
- type VolumeRendererOption
Constants ¶
View Source
const ( CAP_NET_BIND_SERVICE = "NET_BIND_SERVICE" CAP_SYS_NICE = "SYS_NICE" )
View Source
const ( VirtLauncherMonitorOverhead = "25Mi" // The `ps` RSS for virt-launcher-monitor VirtLauncherOverhead = "100Mi" // The `ps` RSS for the virt-launcher process VirtlogdOverhead = "20Mi" // The `ps` RSS for virtlogd VirtqemudOverhead = "35Mi" // The `ps` RSS for virtqemud QemuOverhead = "30Mi" // The `ps` RSS for qemu, minus the RAM of its (stressed) guest, minus the virtual page table // Default: limits.memory = 2*requests.memory DefaultMemoryLimitOverheadRatio = float64(2.0) FailedToRenderLaunchManifestErrFormat = "failed to render launch manifest: %v" )
View Source
const ENV_VAR_LIBVIRT_DEBUG_LOGS = "LIBVIRT_DEBUG_LOGS"
View Source
const ENV_VAR_POD_NAME = "POD_NAME"
View Source
const ENV_VAR_VIRTIOFSD_DEBUG_LOGS = "VIRTIOFSD_DEBUG_LOGS"
View Source
const ENV_VAR_VIRT_LAUNCHER_LOG_VERBOSITY = "VIRT_LAUNCHER_LOG_VERBOSITY"
View Source
const EXT_LOG_VERBOSITY_THRESHOLD = 5
extensive log verbosity threshold after which libvirt debug logs will be enabled
View Source
const IntelVendorName = "Intel"
View Source
const KvmDevice = "devices.kubevirt.io/kvm"
View Source
const LibvirtStartupDelay = 10
LibvirtStartupDelay is added to custom liveness and readiness probes initial delay value. Libvirt needs roughly 10 seconds to start.
View Source
const PrDevice = "devices.kubevirt.io/pr-helper"
View Source
const SevDevice = "devices.kubevirt.io/sev"
View Source
const TunDevice = "devices.kubevirt.io/tun"
View Source
const VhostNetDevice = "devices.kubevirt.io/vhost-net"
View Source
const VhostVsockDevice = "devices.kubevirt.io/vhost-vsock"
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, additionalOverheadRatio *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 PathForNVram ¶ added in v1.1.0
func PathForNVram(vmi *v1.VirtualMachineInstance) string
func PathForSwtpm ¶ added in v1.1.0
func PathForSwtpm(vmi *v1.VirtualMachineInstance) string
func PathForSwtpmLocalca ¶ added in v1.1.0
func PathForSwtpmLocalca(vmi *v1.VirtualMachineInstance) string
func WithAnnotationsGenerators ¶ added in v1.4.0
func WithAnnotationsGenerators(generators ...annotationsGenerator) templateServiceOption
func WithNetBindingPluginMemoryCalculator ¶ added in v1.4.0
func WithNetBindingPluginMemoryCalculator(netBindingPluginMemoryCalculator netBindingPluginMemoryCalculator) templateServiceOption
func WithNetTargetAnnotationsGenerator ¶ added in v1.4.0
func WithNetTargetAnnotationsGenerator(generator targetAnnotationsGenerator) templateServiceOption
func WithSidecarCreator ¶ added in v1.1.0
func WithSidecarCreator(sidecarCreator SidecarCreatorFunc) templateServiceOption
Types ¶
type ContainerSpecRenderer ¶ added in v0.54.0
type ContainerSpecRenderer struct {
// contains filtered or unexported fields
}
func NewContainerSpecRenderer ¶ added in v0.54.0
func NewContainerSpecRenderer(containerName string, launcherImg string, imgPullPolicy k8sv1.PullPolicy, opts ...Option) *ContainerSpecRenderer
type NodeSelectorRenderer ¶ added in v0.58.0
type NodeSelectorRenderer struct {
// contains filtered or unexported fields
}
func NewNodeSelectorRenderer ¶ added in v0.58.0
func NewNodeSelectorRenderer( vmiNodeSelectors map[string]string, clusterWideConfNodeSelectors map[string]string, architecture string, opts ...NodeSelectorRendererOption, ) *NodeSelectorRenderer
func (*NodeSelectorRenderer) Render ¶ added in v0.58.0
func (nsr *NodeSelectorRenderer) Render() map[string]string
type NodeSelectorRendererOption ¶ added in v0.58.0
type NodeSelectorRendererOption func(renderer *NodeSelectorRenderer)
func WithDedicatedCPU ¶ added in v0.58.0
func WithDedicatedCPU() NodeSelectorRendererOption
func WithHyperv ¶ added in v0.58.0
func WithHyperv(features *v1.Features) NodeSelectorRendererOption
func WithModelAndFeatureLabels ¶ added in v0.58.0
func WithModelAndFeatureLabels(modelLabel string, cpuFeatureLabels ...string) NodeSelectorRendererOption
func WithTSCTimer ¶ added in v0.58.0
func WithTSCTimer(tscFrequency *int64) NodeSelectorRendererOption
type Option ¶ added in v0.54.0
type Option func(*ContainerSpecRenderer)
func WithCapabilities ¶ added in v0.54.0
func WithCapabilities(vmi *v1.VirtualMachineInstance) Option
func WithDropALLCapabilities ¶ added in v0.59.0
func WithDropALLCapabilities() Option
func WithLivelinessProbe ¶ added in v0.54.0
func WithLivelinessProbe(vmi *v1.VirtualMachineInstance) Option
func WithNoCapabilities ¶ added in v0.59.0
func WithNoCapabilities() Option
func WithNonRoot ¶ added in v0.54.0
func WithPorts ¶ added in v0.54.0
func WithPorts(vmi *v1.VirtualMachineInstance) Option
func WithPrivileged ¶ added in v0.54.0
func WithPrivileged() Option
func WithReadinessProbe ¶ added in v0.54.0
func WithReadinessProbe(vmi *v1.VirtualMachineInstance) Option
func WithResourceRequirements ¶ added in v0.54.0
func WithResourceRequirements(resources k8sv1.ResourceRequirements) Option
func WithVolumeDevices ¶ added in v0.54.0
func WithVolumeDevices(devices ...k8sv1.VolumeDevice) Option
func WithVolumeMounts ¶ added in v0.54.0
func WithVolumeMounts(mounts ...k8sv1.VolumeMount) Option
type ResourceRenderer ¶ added in v0.56.0
type ResourceRenderer struct {
// contains filtered or unexported fields
}
func NewResourceRenderer ¶ added in v0.56.0
func NewResourceRenderer(vmLimits k8sv1.ResourceList, vmRequests k8sv1.ResourceList, options ...ResourceRendererOption) *ResourceRenderer
func (*ResourceRenderer) Limits ¶ added in v0.56.0
func (rr *ResourceRenderer) Limits() k8sv1.ResourceList
func (*ResourceRenderer) Requests ¶ added in v0.56.0
func (rr *ResourceRenderer) Requests() k8sv1.ResourceList
func (*ResourceRenderer) ResourceRequirements ¶ added in v0.56.0
func (rr *ResourceRenderer) ResourceRequirements() k8sv1.ResourceRequirements
type ResourceRendererOption ¶ added in v0.56.0
type ResourceRendererOption func(renderer *ResourceRenderer)
func WithAutoMemoryLimits ¶ added in v1.0.1
func WithAutoMemoryLimits(namespace string, namespaceStore cache.Store) ResourceRendererOption
func WithCPUPinning ¶ added in v0.56.0
func WithCPUPinning(cpu *v1.CPU, annotations map[string]string) ResourceRendererOption
func WithEphemeralStorageRequest ¶ added in v0.56.0
func WithEphemeralStorageRequest() ResourceRendererOption
func WithGPUs ¶ added in v0.56.0
func WithGPUs(gpus []v1.GPU) ResourceRendererOption
func WithHostDevices ¶ added in v0.56.0
func WithHostDevices(hostDevices []v1.HostDevice) ResourceRendererOption
func WithHugePages ¶ added in v0.56.0
func WithHugePages(vmMemory *v1.Memory, memoryOverhead resource.Quantity) ResourceRendererOption
func WithMemoryOverhead ¶ added in v0.56.0
func WithMemoryOverhead(guestResourceSpec v1.ResourceRequirements, memoryOverhead resource.Quantity) ResourceRendererOption
func WithNetworkResources ¶ added in v0.56.0
func WithNetworkResources(networkToResourceMap map[string]string) ResourceRendererOption
func WithPersistentReservation ¶ added in v1.0.0
func WithPersistentReservation() ResourceRendererOption
func WithSEV ¶ added in v0.56.0
func WithSEV() ResourceRendererOption
func WithVirtualizationResources ¶ added in v0.56.0
func WithVirtualizationResources(virtResources k8sv1.ResourceList) ResourceRendererOption
func WithoutDedicatedCPU ¶ added in v0.56.0
func WithoutDedicatedCPU(cpu *v1.CPU, cpuAllocationRatio int, withCPULimits bool) ResourceRendererOption
type SidecarCreatorFunc ¶ added in v1.1.0
type SidecarCreatorFunc func(*v1.VirtualMachineInstance, *v1.KubeVirtConfiguration) (hooks.HookSidecarList, error)
type TemplateService ¶
type TemplateService interface { RenderMigrationManifest(vmi *v1.VirtualMachineInstance, migration *v1.VirtualMachineInstanceMigration, sourcePod *k8sv1.Pod) (*k8sv1.Pod, error) RenderLaunchManifest(vmi *v1.VirtualMachineInstance) (*k8sv1.Pod, error) RenderHotplugAttachmentPodTemplate(volumes []*v1.Volume, ownerPod *k8sv1.Pod, vmi *v1.VirtualMachineInstance, claimMap map[string]*k8sv1.PersistentVolumeClaim) (*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) RenderExporterManifest(vmExport *exportv1.VirtualMachineExport, namePrefix string) *k8sv1.Pod GetLauncherImage() string IsPPC64() bool IsARM64() bool IsS390X() 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, exporterImage string, resourceQuotaStore cache.Store, namespaceStore cache.Store, opts ...templateServiceOption, ) TemplateService
type VMIResourcePredicates ¶ added in v0.56.0
type VMIResourcePredicates struct {
// contains filtered or unexported fields
}
func (VMIResourcePredicates) Apply ¶ added in v0.56.0
func (p VMIResourcePredicates) Apply() []ResourceRendererOption
type VMIResourceRule ¶ added in v0.56.0
type VMIResourceRule struct {
// contains filtered or unexported fields
}
func NewVMIResourceRule ¶ added in v0.56.0
func NewVMIResourceRule(p resourcePredicate, option ResourceRendererOption) VMIResourceRule
type VolumeRenderer ¶ added in v0.55.0
type VolumeRenderer struct {
// contains filtered or unexported fields
}
func NewVolumeRenderer ¶ added in v0.55.0
func NewVolumeRenderer(namespace string, ephemeralDisk string, containerDiskDir string, virtShareDir string, volumeOptions ...VolumeRendererOption) (*VolumeRenderer, error)
func (*VolumeRenderer) Mounts ¶ added in v0.55.0
func (vr *VolumeRenderer) Mounts() []k8sv1.VolumeMount
func (*VolumeRenderer) VolumeDevices ¶ added in v0.55.0
func (vr *VolumeRenderer) VolumeDevices() []k8sv1.VolumeDevice
func (*VolumeRenderer) Volumes ¶ added in v0.55.0
func (vr *VolumeRenderer) Volumes() []k8sv1.Volume
type VolumeRendererOption ¶ added in v0.55.0
type VolumeRendererOption func(renderer *VolumeRenderer) error
Click to show internal directories.
Click to hide internal directories.