virtconfig

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Index

Constants

View Source
const (
	ExpandDisksGate   = "ExpandDisks"
	CPUManager        = "CPUManager"
	NUMAFeatureGate   = "NUMA"
	IgnitionGate      = "ExperimentalIgnitionSupport"
	LiveMigrationGate = "LiveMigration"
	// SRIOVLiveMigrationGate enables Live Migration for VM's with network SR-IOV interfaces.
	SRIOVLiveMigrationGate     = "SRIOVLiveMigration"
	CPUNodeDiscoveryGate       = "CPUNodeDiscovery"
	HypervStrictCheckGate      = "HypervStrictCheck"
	SidecarGate                = "Sidecar"
	GPUGate                    = "GPU"
	HostDevicesGate            = "HostDevices"
	SnapshotGate               = "Snapshot"
	VMExportGate               = "VMExport"
	HotplugVolumesGate         = "HotplugVolumes"
	HostDiskGate               = "HostDisk"
	VirtIOFSGate               = "ExperimentalVirtiofsSupport"
	MacvtapGate                = "Macvtap"
	PasstGate                  = "Passt"
	DownwardMetricsFeatureGate = "DownwardMetrics"
	NonRootDeprecated          = "NonRootExperimental"
	NonRoot                    = "NonRoot"
	Root                       = "Root"
	ClusterProfiler            = "ClusterProfiler"
	WorkloadEncryptionSEV      = "WorkloadEncryptionSEV"
	// DockerSELinuxMCSWorkaround sets the SELinux level of all the non-compute virt-launcher containers to "s0".
	DockerSELinuxMCSWorkaround = "DockerSELinuxMCSWorkaround"
	PSA                        = "PSA"
	VSOCKGate                  = "VSOCK"
	// DisableCustomSELinuxPolicy disables the installation of the custom SELinux policy for virt-launcher
	DisableCustomSELinuxPolicy = "DisableCustomSELinuxPolicy"
	// KubevirtSeccompProfile indicate that Kubevirt will install its custom profile and
	// user can tell Kubevirt to use it
	KubevirtSeccompProfile = "KubevirtSeccompProfile"
	// DisableMediatedDevicesHandling disables the handling of mediated
	// devices, its creation and deletion
	DisableMediatedDevicesHandling = "DisableMDEVConfiguration"
	// HotplugNetworkIfacesGate enables the virtio network interface hotplug feature
	HotplugNetworkIfacesGate = "HotplugNICs"
	// PersistentReservation enables the use of the SCSI persistent reservation with the pr-helper daemon
	PersistentReservation = "PersistentReservation"
	// VMPersistentState enables persisting backend state files of VMs, such as the contents of the vTPM
	VMPersistentState = "VMPersistentState"
	Multiarchitecture = "MultiArchitecture"
	// VMLiveUpdateFeaturesGate allows updating ceratin VM fields, such as CPU sockets to enable hot-plug functionality.
	VMLiveUpdateFeaturesGate = "VMLiveUpdateFeatures"
	// AutoResourceLimitsGate enables automatic setting of vmi limits if there is a ResourceQuota with limits associated with the vmi namespace.
	AutoResourceLimitsGate = "AutoResourceLimitsGate"
)
View Source
const (
	ParallelOutboundMigrationsPerNodeDefault uint32 = 2
	ParallelMigrationsPerClusterDefault      uint32 = 5
	BandwidthPerMigrationDefault                    = "0Mi"
	MigrationAllowAutoConverge               bool   = false
	MigrationAllowPostCopy                   bool   = false
	MigrationProgressTimeout                 int64  = 150
	MigrationCompletionTimeoutPerGiB         int64  = 800
	DefaultAMD64MachineType                         = "q35"
	DefaultPPC64LEMachineType                       = "pseries"
	DefaultAARCH64MachineType                       = "virt"
	DefaultCPURequest                               = "100m"
	DefaultMemoryOvercommit                         = 100
	DefaultAMD64EmulatedMachines                    = "q35*,pc-q35*"
	DefaultPPC64LEEmulatedMachines                  = "pseries*"
	DefaultAARCH64EmulatedMachines                  = "virt*"
	DefaultLessPVCSpaceToleration                   = 10
	DefaultMinimumReservePVCBytes                   = 131072
	DefaultNodeSelectors                            = ""
	DefaultNetworkInterface                         = "bridge"
	DefaultImagePullPolicy                          = k8sv1.PullIfNotPresent
	DefaultAllowEmulation                           = false
	DefaultUnsafeMigrationOverride                  = false
	DefaultPermitSlirpInterface                     = false
	SmbiosConfigDefaultFamily                       = "KubeVirt"
	SmbiosConfigDefaultManufacturer                 = "KubeVirt"
	SmbiosConfigDefaultProduct                      = "None"
	DefaultPermitBridgeInterfaceOnPodNetwork        = true
	DefaultSELinuxLauncherType                      = ""
	SupportedGuestAgentVersions                     = "2.*,3.*,4.*,5.*"
	DefaultARCHOVMFPath                             = "/usr/share/OVMF"
	DefaultAARCH64OVMFPath                          = "/usr/share/AAVMF"
	DefaultMemBalloonStatsPeriod             uint32 = 10
	DefaultCPUAllocationRatio                       = 10
	DefaultDiskVerificationMemoryLimitMBytes        = 2000
	DefaultVirtAPILogVerbosity                      = 2
	DefaultVirtControllerLogVerbosity               = 2
	DefaultVirtHandlerLogVerbosity                  = 2
	DefaultVirtLauncherLogVerbosity                 = 2
	DefaultVirtOperatorLogVerbosity                 = 2

	// Default REST configuration settings
	DefaultVirtHandlerQPS         float32 = 5
	DefaultVirtHandlerBurst               = 10
	DefaultVirtControllerQPS      float32 = 200
	DefaultVirtControllerBurst            = 400
	DefaultVirtAPIQPS             float32 = 5
	DefaultVirtAPIBurst                   = 10
	DefaultVirtWebhookClientQPS           = 200
	DefaultVirtWebhookClientBurst         = 400
)
View Source
const (
	NodeDrainTaintDefaultKey = "kubevirt.io/drain"
)

Variables

This section is empty.

Functions

func IsAMD64 added in v0.43.0

func IsAMD64(arch string) bool

func IsARM64 added in v0.43.0

func IsARM64(arch string) bool

func IsPPC64 added in v0.43.0

func IsPPC64(arch string) bool

Types

type ClusterConfig added in v0.16.0

type ClusterConfig struct {
	// contains filtered or unexported fields
}

func NewClusterConfig added in v0.16.0

func NewClusterConfig(crdInformer cache.SharedIndexInformer,
	kubeVirtInformer cache.SharedIndexInformer,
	namespace string) (*ClusterConfig, error)

NewClusterConfig is a wrapper of NewClusterConfigWithCPUArch with default cpuArch.

func NewClusterConfigWithCPUArch added in v0.43.0

func NewClusterConfigWithCPUArch(crdInformer cache.SharedIndexInformer,
	kubeVirtInformer cache.SharedIndexInformer,
	namespace, cpuArch string) (*ClusterConfig, error)

NewClusterConfigWithCPUArch represents the `kubevirt-config` config map. It can be used to live-update values if the config changes. The config update works like this: 1. Check if the config exists. If it does not exist, return the default config 2. Check if the config got updated. If so, try to parse and return it 3. In case of errors or no updates (resource version stays the same), it returns the values from the last good config

func (*ClusterConfig) AllowEmulation added in v0.45.0

func (c *ClusterConfig) AllowEmulation() bool

func (*ClusterConfig) AutoResourceLimitsEnabled added in v1.0.1

func (config *ClusterConfig) AutoResourceLimitsEnabled() bool

func (*ClusterConfig) CPUManagerEnabled added in v0.18.0

func (config *ClusterConfig) CPUManagerEnabled() bool

func (*ClusterConfig) CPUNodeDiscoveryEnabled added in v0.18.0

func (config *ClusterConfig) CPUNodeDiscoveryEnabled() bool

func (*ClusterConfig) ClusterProfilerEnabled added in v0.46.0

func (config *ClusterConfig) ClusterProfilerEnabled() bool

func (*ClusterConfig) CustomSELinuxPolicyDisabled added in v0.59.0

func (config *ClusterConfig) CustomSELinuxPolicyDisabled() bool

func (*ClusterConfig) DockerSELinuxMCSWorkaroundEnabled added in v0.58.0

func (config *ClusterConfig) DockerSELinuxMCSWorkaroundEnabled() bool

func (*ClusterConfig) DownwardMetricsEnabled added in v0.42.0

func (config *ClusterConfig) DownwardMetricsEnabled() bool

func (*ClusterConfig) ExpandDisksEnabled added in v0.48.0

func (config *ClusterConfig) ExpandDisksEnabled() bool

func (*ClusterConfig) GPUPassthroughEnabled added in v0.22.0

func (config *ClusterConfig) GPUPassthroughEnabled() bool

func (*ClusterConfig) GetCPUAllocationRatio added in v0.34.0

func (c *ClusterConfig) GetCPUAllocationRatio() int

func (*ClusterConfig) GetCPUModel added in v0.17.0

func (c *ClusterConfig) GetCPUModel() string

func (*ClusterConfig) GetCPURequest added in v0.17.0

func (c *ClusterConfig) GetCPURequest() *resource.Quantity

func (*ClusterConfig) GetClusterCPUArch added in v0.44.1

func (c *ClusterConfig) GetClusterCPUArch() string

GetClusterCPUArch return the CPU architecture in ClusterConfig

func (*ClusterConfig) GetConfig added in v0.31.0

func (c *ClusterConfig) GetConfig() (config *v1.KubeVirtConfiguration)

getConfig returns the latest valid parsed config map result, or updates it if a newer version is available. XXX Rework this, to happen mostly in informer callbacks. This will also allow us then to react to config changes and e.g. restart some controllers

func (*ClusterConfig) GetConfigFromKubeVirtCR added in v0.44.1

func (c *ClusterConfig) GetConfigFromKubeVirtCR() *v1.KubeVirt

func (*ClusterConfig) GetDefaultArchitecture added in v1.0.0

func (c *ClusterConfig) GetDefaultArchitecture() string

func (*ClusterConfig) GetDefaultClusterConfig added in v0.31.0

func (c *ClusterConfig) GetDefaultClusterConfig() *v1.KubeVirtConfiguration

func (*ClusterConfig) GetDefaultNetworkInterface added in v0.19.0

func (c *ClusterConfig) GetDefaultNetworkInterface() string

func (*ClusterConfig) GetDefaultRuntimeClass added in v0.44.1

func (c *ClusterConfig) GetDefaultRuntimeClass() string

func (*ClusterConfig) GetDesiredMDEVTypes added in v0.45.0

func (c *ClusterConfig) GetDesiredMDEVTypes(node *k8sv1.Node) []string

func (*ClusterConfig) GetDeveloperConfigurationUseEmulation added in v1.0.0

func (c *ClusterConfig) GetDeveloperConfigurationUseEmulation() bool

GetDeveloperConfigurationUseEmulation return the UseEmulation value in DeveloperConfiguration

func (*ClusterConfig) GetDiskVerification added in v0.43.1

func (c *ClusterConfig) GetDiskVerification() *v1.DiskVerification

func (*ClusterConfig) GetEmulatedMachines added in v0.18.0

func (c *ClusterConfig) GetEmulatedMachines(arch string) []string

func (*ClusterConfig) GetImagePullPolicy added in v0.16.0

func (c *ClusterConfig) GetImagePullPolicy() (policy k8sv1.PullPolicy)

func (*ClusterConfig) GetKSMConfiguration added in v1.0.0

func (c *ClusterConfig) GetKSMConfiguration() *v1.KSMConfiguration

func (*ClusterConfig) GetLessPVCSpaceToleration added in v0.18.0

func (c *ClusterConfig) GetLessPVCSpaceToleration() int

func (*ClusterConfig) GetMachineType added in v0.17.0

func (c *ClusterConfig) GetMachineType(arch string) string

func (*ClusterConfig) GetMaximumCpuSockets added in v1.0.0

func (c *ClusterConfig) GetMaximumCpuSockets() (numOfSockets uint32)

func (*ClusterConfig) GetMemBalloonStatsPeriod added in v0.33.0

func (c *ClusterConfig) GetMemBalloonStatsPeriod() uint32

func (*ClusterConfig) GetMemoryOvercommit added in v0.19.0

func (c *ClusterConfig) GetMemoryOvercommit() int

func (*ClusterConfig) GetMigrationConfiguration added in v0.31.0

func (c *ClusterConfig) GetMigrationConfiguration() *v1.MigrationConfiguration

func (*ClusterConfig) GetMinCPUModel added in v0.40.0

func (c *ClusterConfig) GetMinCPUModel() string

GetMinCPUModel return minimal cpu which is used in node-labeller

func (*ClusterConfig) GetMinimumClusterTSCFrequency added in v0.43.0

func (c *ClusterConfig) GetMinimumClusterTSCFrequency() *int64

func (*ClusterConfig) GetMinimumReservePVCBytes added in v0.43.0

func (c *ClusterConfig) GetMinimumReservePVCBytes() uint64

func (*ClusterConfig) GetNodeSelectors added in v0.18.0

func (c *ClusterConfig) GetNodeSelectors() map[string]string

func (*ClusterConfig) GetOVMFPath added in v0.30.0

func (c *ClusterConfig) GetOVMFPath(arch string) string

func (*ClusterConfig) GetObsoleteCPUModels added in v0.40.0

func (c *ClusterConfig) GetObsoleteCPUModels() map[string]bool

GetObsoleteCPUModels return slice of obsolete cpus which are used in node-labeller

func (*ClusterConfig) GetPermittedHostDevices added in v0.36.0

func (c *ClusterConfig) GetPermittedHostDevices() *v1.PermittedHostDevices

func (*ClusterConfig) GetResourceVersion added in v0.30.5

func (c *ClusterConfig) GetResourceVersion() string

func (*ClusterConfig) GetSELinuxLauncherType added in v0.26.1

func (c *ClusterConfig) GetSELinuxLauncherType() string

func (*ClusterConfig) GetSMBIOS added in v0.21.0

func (c *ClusterConfig) GetSMBIOS() *v1.SMBiosConfiguration

func (*ClusterConfig) GetSupportContainerLimit added in v1.0.0

func (c *ClusterConfig) GetSupportContainerLimit(typeName v1.SupportContainerType, resourceName k8sv1.ResourceName) *resource.Quantity

func (*ClusterConfig) GetSupportContainerRequest added in v1.0.0

func (c *ClusterConfig) GetSupportContainerRequest(typeName v1.SupportContainerType, resourceName k8sv1.ResourceName) *resource.Quantity

func (*ClusterConfig) GetSupportedAgentVersions added in v0.29.0

func (c *ClusterConfig) GetSupportedAgentVersions() []string

func (*ClusterConfig) GetVMStateStorageClass added in v1.0.0

func (c *ClusterConfig) GetVMStateStorageClass() string

func (*ClusterConfig) GetVirtAPIVerbosity added in v0.38.0

func (c *ClusterConfig) GetVirtAPIVerbosity(nodeName string) uint

func (*ClusterConfig) GetVirtControllerVerbosity added in v0.38.0

func (c *ClusterConfig) GetVirtControllerVerbosity(nodeName string) uint

func (*ClusterConfig) GetVirtHandlerVerbosity added in v0.38.0

func (c *ClusterConfig) GetVirtHandlerVerbosity(nodeName string) uint

func (*ClusterConfig) GetVirtLauncherVerbosity added in v0.38.0

func (c *ClusterConfig) GetVirtLauncherVerbosity() uint

func (*ClusterConfig) GetVirtOperatorVerbosity added in v0.58.0

func (c *ClusterConfig) GetVirtOperatorVerbosity(nodeName string) uint

func (*ClusterConfig) HasDataSourceAPI added in v0.46.0

func (c *ClusterConfig) HasDataSourceAPI() bool

func (*ClusterConfig) HasDataVolumeAPI added in v0.20.0

func (c *ClusterConfig) HasDataVolumeAPI() bool

func (*ClusterConfig) HasPrometheusRuleAPI added in v1.0.0

func (c *ClusterConfig) HasPrometheusRuleAPI() bool

func (*ClusterConfig) HasServiceMonitorAPI added in v1.0.0

func (c *ClusterConfig) HasServiceMonitorAPI() bool

func (*ClusterConfig) HostDevicesPassthroughEnabled added in v0.36.0

func (config *ClusterConfig) HostDevicesPassthroughEnabled() bool

func (*ClusterConfig) HostDiskEnabled added in v0.30.3

func (config *ClusterConfig) HostDiskEnabled() bool

func (*ClusterConfig) HotplugNetworkInterfacesEnabled added in v1.0.0

func (config *ClusterConfig) HotplugNetworkInterfacesEnabled() bool

func (*ClusterConfig) HotplugVolumesEnabled added in v0.36.0

func (config *ClusterConfig) HotplugVolumesEnabled() bool

func (*ClusterConfig) HypervStrictCheckEnabled added in v0.18.0

func (config *ClusterConfig) HypervStrictCheckEnabled() bool

func (*ClusterConfig) IgnitionEnabled added in v0.18.0

func (config *ClusterConfig) IgnitionEnabled() bool

func (*ClusterConfig) IsBridgeInterfaceOnPodNetworkEnabled added in v0.21.0

func (c *ClusterConfig) IsBridgeInterfaceOnPodNetworkEnabled() bool

func (*ClusterConfig) IsFeatureGateDeprecated added in v0.56.0

func (config *ClusterConfig) IsFeatureGateDeprecated(featureGate string) bool

func (*ClusterConfig) IsFreePageReportingDisabled added in v1.0.0

func (c *ClusterConfig) IsFreePageReportingDisabled() bool

func (*ClusterConfig) IsSlirpInterfaceEnabled added in v0.19.0

func (c *ClusterConfig) IsSlirpInterfaceEnabled() bool

func (*ClusterConfig) KubevirtSeccompProfileEnabled added in v0.59.0

func (config *ClusterConfig) KubevirtSeccompProfileEnabled() bool

func (*ClusterConfig) LiveMigrationEnabled added in v0.18.0

func (config *ClusterConfig) LiveMigrationEnabled() bool

func (*ClusterConfig) MacvtapEnabled added in v0.35.0

func (config *ClusterConfig) MacvtapEnabled() bool

func (*ClusterConfig) MediatedDevicesHandlingDisabled added in v0.58.2

func (config *ClusterConfig) MediatedDevicesHandlingDisabled() bool

func (*ClusterConfig) MultiArchitectureEnabled added in v1.0.0

func (config *ClusterConfig) MultiArchitectureEnabled() bool

func (*ClusterConfig) NUMAEnabled added in v0.43.0

func (config *ClusterConfig) NUMAEnabled() bool

func (*ClusterConfig) PasstEnabled added in v0.56.0

func (config *ClusterConfig) PasstEnabled() bool

func (*ClusterConfig) PersistentReservationEnabled added in v1.0.0

func (config *ClusterConfig) PersistentReservationEnabled() bool

func (*ClusterConfig) RootEnabled added in v0.59.0

func (config *ClusterConfig) RootEnabled() bool

func (*ClusterConfig) SRIOVLiveMigrationEnabled added in v0.39.0

func (config *ClusterConfig) SRIOVLiveMigrationEnabled() bool

func (*ClusterConfig) SetConfigModifiedCallback added in v0.20.0

func (c *ClusterConfig) SetConfigModifiedCallback(cb ConfigModifiedFn)

func (*ClusterConfig) SetVMISpecDefaultNetworkInterface added in v0.59.0

func (c *ClusterConfig) SetVMISpecDefaultNetworkInterface(spec *v1.VirtualMachineInstanceSpec) error

func (*ClusterConfig) SidecarEnabled added in v0.20.0

func (config *ClusterConfig) SidecarEnabled() bool

func (*ClusterConfig) SnapshotEnabled added in v0.31.0

func (config *ClusterConfig) SnapshotEnabled() bool

func (*ClusterConfig) VMExportEnabled added in v0.55.0

func (config *ClusterConfig) VMExportEnabled() bool

func (*ClusterConfig) VMLiveUpdateFeaturesEnabled added in v1.0.0

func (config *ClusterConfig) VMLiveUpdateFeaturesEnabled() bool

func (*ClusterConfig) VMPersistentStateEnabled added in v1.0.0

func (config *ClusterConfig) VMPersistentStateEnabled() bool

func (*ClusterConfig) VSOCKEnabled added in v0.59.0

func (config *ClusterConfig) VSOCKEnabled() bool

func (*ClusterConfig) VirtiofsEnabled added in v0.34.0

func (config *ClusterConfig) VirtiofsEnabled() bool

func (*ClusterConfig) WorkloadEncryptionSEVEnabled added in v0.49.0

func (config *ClusterConfig) WorkloadEncryptionSEVEnabled() bool

type ConfigModifiedFn added in v0.20.0

type ConfigModifiedFn func()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL