Documentation ¶
Index ¶
- Constants
- func Execute()
- func MatchPolicy(policyList *v1alpha1.MigrationPolicyList, vmi *k6tv1.VirtualMachineInstance, ...) *v1alpha1.MigrationPolicy
- func OwnerRef(rs *virtv1.VirtualMachineInstanceReplicaSet) metav1.OwnerReference
- type CloneAuthFunc
- type MigrationController
- type NodeController
- type PoolController
- type VMController
- func (c *VMController) Execute() bool
- func (c *VMController) Run(threadiness int, stopCh <-chan struct{})
- func (c *VMController) VMIAffinityPatch(vm *virtv1.VirtualMachine, vmi *virtv1.VirtualMachineInstance) error
- func (c *VMController) VMICPUsPatch(vm *virtv1.VirtualMachine, vmi *virtv1.VirtualMachineInstance) error
- func (c *VMController) VMNodeSelectorPatch(vm *virtv1.VirtualMachine, vmi *virtv1.VirtualMachineInstance) error
- type VMIController
- type VMIReplicaSet
- type VirtControllerApp
- type VirtualMachineRevisionData
Constants ¶
const ( FailedUpdateVirtualMachineReason = "FailedUpdate" SuccessfulUpdateVirtualMachineReason = "SuccessfulUpdate" )
const ( FailedScaleOutReason = "FailedScaleOut" FailedScaleInReason = "FailedScaleIn" FailedUpdateReason = "FailedUpdate" FailedRevisionPruningReason = "FailedRevisionPruning" SuccessfulPausedPoolReason = "SuccessfulPaused" SuccessfulResumePoolReason = "SuccessfulResume" )
const ( // FailedCreateVirtualMachineReason is added in an event and in a replica set condition // when a virtual machine for a replica set is failed to be created. FailedCreateVirtualMachineReason = "FailedCreate" // SuccessfulCreateVirtualMachineReason is added in an event when a virtual machine for a replica set // is successfully created. SuccessfulCreateVirtualMachineReason = "SuccessfulCreate" // FailedDeleteVirtualMachineReason is added in an event and in a replica set condition // when a virtual machine for a replica set is failed to be deleted. FailedDeleteVirtualMachineReason = "FailedDelete" // SuccessfulDeleteVirtualMachineReason is added in an event when a virtual machine for a replica set // is successfully deleted. SuccessfulDeleteVirtualMachineReason = "SuccessfulDelete" // SuccessfulPausedReplicaSetReason is added in an event when the replica set discovered that it // should be paused. The event is triggered after it successfully managed to add the Paused Condition // to itself. SuccessfulPausedReplicaSetReason = "SuccessfulPaused" // SuccessfulResumedReplicaSetReason is added in an event when the replica set discovered that it // should be resumed. The event is triggered after it successfully managed to remove the Paused Condition // from itself. SuccessfulResumedReplicaSetReason = "SuccessfulResumed" )
Reasons for replicaset events
const ( // ServiceAccount doesn't have permission to create a DataVolume UnauthorizedDataVolumeCreateReason = "UnauthorizedDataVolumeCreate" // FailedDataVolumeCreateReason is added in an event when posting a dynamically // generated dataVolume to the cluster fails. FailedDataVolumeCreateReason = "FailedDataVolumeCreate" // SuccessfulDataVolumeCreateReason is added in an event when a dynamically generated // dataVolume is successfully created SuccessfulDataVolumeCreateReason = "SuccessfulDataVolumeCreate" // SourcePVCNotAvailabe is added in an event when the source PVC of a valid // clone Datavolume doesn't exist SourcePVCNotAvailabe = "SourcePVCNotAvailabe" )
Repeating info / error messages
const ( HotPlugVolumeErrorReason = "HotPlugVolumeError" HotPlugCPUErrorReason = "HotPlugCPUError" MemoryDumpErrorReason = "MemoryDumpError" FailedUpdateErrorReason = "FailedUpdateError" FailedCreateReason = "FailedCreate" VMIFailedDeleteReason = "FailedDelete" HotPlugNetworkInterfaceErrorReason = "HotPlugNetworkInterfaceError" AffinityChangeErrorReason = "AffinityChangeError" HotPlugMemoryErrorReason = "HotPlugMemoryError" )
const ( // FailedCreatePodReason is added in an event and in a vmi controller condition // when a pod for a vmi controller failed to be created. FailedCreatePodReason = "FailedCreate" // SuccessfulCreatePodReason is added in an event when a pod for a vmi controller // is successfully created. SuccessfulCreatePodReason = "SuccessfulCreate" // FailedDeletePodReason is added in an event and in a vmi controller condition // when a pod for a vmi controller failed to be deleted. FailedDeletePodReason = "FailedDelete" // SuccessfulDeletePodReason is added in an event when a pod for a vmi controller // is successfully deleted. SuccessfulDeletePodReason = "SuccessfulDelete" // FailedHandOverPodReason is added in an event and in a vmi controller condition // when transferring the pod ownership from the controller to virt-hander fails. FailedHandOverPodReason = "FailedHandOver" // FailedBackendStorageCreateReason is added in an event when posting a dynamically // generated dataVolume to the cluster fails. FailedBackendStorageCreateReason = "FailedBackendStorageCreate" // SuccessfulHandOverPodReason is added in an event // when the pod ownership transfer from the controller to virt-hander succeeds. SuccessfulHandOverPodReason = "SuccessfulHandOver" // FailedDataVolumeImportReason is added in an event when a dynamically generated // dataVolume reaches the failed status phase. FailedDataVolumeImportReason = "FailedDataVolumeImport" // FailedGuaranteePodResourcesReason is added in an event and in a vmi controller condition // when a pod has been created without a Guaranteed resources. FailedGuaranteePodResourcesReason = "FailedGuaranteeResources" // FailedGatherhingClusterTopologyHints is added if the cluster topology hints can't be collected for a VMI by virt-controller FailedGatherhingClusterTopologyHints = "FailedGatherhingClusterTopologyHints" // FailedPvcNotFoundReason is added in an event // when a PVC for a volume was not found. FailedPvcNotFoundReason = "FailedPvcNotFound" // SuccessfulMigrationReason is added when a migration attempt completes successfully SuccessfulMigrationReason = "SuccessfulMigration" // FailedMigrationReason is added when a migration attempt fails FailedMigrationReason = "FailedMigration" // SuccessfulAbortMigrationReason is added when an attempt to abort migration completes successfully SuccessfulAbortMigrationReason = "SuccessfulAbortMigration" // MigrationTargetPodUnschedulable is added a migration target pod enters Unschedulable phase MigrationTargetPodUnschedulable = "migrationTargetPodUnschedulable" // FailedAbortMigrationReason is added when an attempt to abort migration fails FailedAbortMigrationReason = "FailedAbortMigration" // MissingAttachmentPodReason is set when we have a hotplugged volume, but the attachment pod is missing MissingAttachmentPodReason = "MissingAttachmentPod" // PVCNotReadyReason is set when the PVC is not ready to be hot plugged. PVCNotReadyReason = "PVCNotReady" // FailedHotplugSyncReason is set when a hotplug specific failure occurs during sync FailedHotplugSyncReason = "FailedHotplugSync" // ErrImagePullReason is set when an error has occured while pulling an image for a containerDisk VM volume. ErrImagePullReason = "ErrImagePull" // ImagePullBackOffReason is set when an error has occured while pulling an image for a containerDisk VM volume, // and that kubelet is backing off before retrying. ImagePullBackOffReason = "ImagePullBackOff" // NoSuitableNodesForHostModelMigration is set when a VMI with host-model CPU mode tries to migrate but no node // is suitable for migration (since CPU model / required features are not supported) NoSuitableNodesForHostModelMigration = "NoSuitableNodesForHostModelMigration" // FailedPodPatchReason is set when a pod patch error occurs during sync FailedPodPatchReason = "FailedPodPatch" // MigrationBackoffReason is set when an error has occured while migrating // and virt-controller is backing off before retrying. MigrationBackoffReason = "MigrationBackoff" )
Reasons for vmi events
const ( // NodeUnresponsiveReason is in various places as reason to indicate that // an action was taken because virt-handler became unresponsive. NodeUnresponsiveReason = "NodeUnresponsive" )
Variables ¶
This section is empty.
Functions ¶
func MatchPolicy ¶ added in v0.55.0
func MatchPolicy(policyList *v1alpha1.MigrationPolicyList, vmi *k6tv1.VirtualMachineInstance, vmiNamespace *k8sv1.Namespace) *v1alpha1.MigrationPolicy
MatchPolicy returns the policy that is matched to the vmi, or nil of no policy is matched.
Since every policy can specify VMI and Namespace labels to match to, matching is done by returning the most detailed policy, meaning the policy that matches the VMI and specifies the most labels that matched either the VMI or its namespace labels.
If two policies are matched and have the same level of details (i.e. same number of matching labels) the matched policy is chosen by policies' names ordered by lexicographic order. The reason is to create a rather arbitrary yet deterministic way of matching policies.
func OwnerRef ¶ added in v0.1.0
func OwnerRef(rs *virtv1.VirtualMachineInstanceReplicaSet) metav1.OwnerReference
Types ¶
type CloneAuthFunc ¶ added in v0.20.0
type CloneAuthFunc func(dv *cdiv1.DataVolume, requestNamespace, requestName string, proxy cdiv1.AuthorizationHelperProxy, saNamespace, saName string) (bool, string, error)
type MigrationController ¶
type MigrationController struct { Queue workqueue.RateLimitingInterface // contains filtered or unexported fields }
func NewMigrationController ¶
func NewMigrationController(templateService services.TemplateService, vmiInformer cache.SharedIndexInformer, podInformer cache.SharedIndexInformer, migrationInformer cache.SharedIndexInformer, nodeInformer cache.SharedIndexInformer, pvcInformer cache.SharedIndexInformer, pdbInformer cache.SharedIndexInformer, migrationPolicyInformer cache.SharedIndexInformer, resourceQuotaInformer cache.SharedIndexInformer, recorder record.EventRecorder, clientset kubecli.KubevirtClient, clusterConfig *virtconfig.ClusterConfig, ) (*MigrationController, error)
func (*MigrationController) Execute ¶
func (c *MigrationController) Execute() bool
func (*MigrationController) Run ¶
func (c *MigrationController) Run(threadiness int, stopCh <-chan struct{})
type NodeController ¶ added in v0.5.0
type NodeController struct { Queue workqueue.RateLimitingInterface // contains filtered or unexported fields }
NodeController is the main NodeController struct.
func NewNodeController ¶ added in v0.5.0
func NewNodeController(clientset kubecli.KubevirtClient, nodeInformer cache.SharedIndexInformer, vmiInformer cache.SharedIndexInformer, recorder record.EventRecorder) (*NodeController, error)
NewNodeController creates a new instance of the NodeController struct.
func (*NodeController) Execute ¶ added in v0.5.0
func (c *NodeController) Execute() bool
Execute runs commands from the controller queue, if there is an error it requeues the command. Returns false if the queue is empty.
func (*NodeController) Run ¶ added in v0.5.0
func (c *NodeController) Run(threadiness int, stopCh <-chan struct{})
Run runs the passed in NodeController.
type PoolController ¶ added in v0.49.0
type PoolController struct {
// contains filtered or unexported fields
}
PoolController is the main PoolController struct.
func NewPoolController ¶ added in v0.49.0
func NewPoolController(clientset kubecli.KubevirtClient, vmiInformer cache.SharedIndexInformer, vmInformer cache.SharedIndexInformer, poolInformer cache.SharedIndexInformer, revisionInformer cache.SharedIndexInformer, recorder record.EventRecorder, burstReplicas uint) (*PoolController, error)
NewPoolController creates a new instance of the PoolController struct.
func (*PoolController) Execute ¶ added in v0.49.0
func (c *PoolController) Execute() bool
Execute runs commands from the controller queue, if there is an error it requeues the command. Returns false if the queue is empty.
func (*PoolController) Run ¶ added in v0.49.0
func (c *PoolController) Run(threadiness int, stopCh <-chan struct{})
Run runs the passed in PoolController.
type VMController ¶
type VMController struct { Queue workqueue.RateLimitingInterface // contains filtered or unexported fields }
func NewVMController ¶
func NewVMController(vmiInformer cache.SharedIndexInformer, vmInformer cache.SharedIndexInformer, dataVolumeInformer cache.SharedIndexInformer, dataSourceInformer cache.SharedIndexInformer, namespaceStore cache.Store, pvcInformer cache.SharedIndexInformer, crInformer cache.SharedIndexInformer, podInformer cache.SharedIndexInformer, instancetypeMethods instancetype.Methods, recorder record.EventRecorder, clientset kubecli.KubevirtClient, clusterConfig *virtconfig.ClusterConfig) (*VMController, error)
func (*VMController) Execute ¶
func (c *VMController) Execute() bool
func (*VMController) Run ¶
func (c *VMController) Run(threadiness int, stopCh <-chan struct{})
func (*VMController) VMIAffinityPatch ¶ added in v1.1.0
func (c *VMController) VMIAffinityPatch(vm *virtv1.VirtualMachine, vmi *virtv1.VirtualMachineInstance) error
func (*VMController) VMICPUsPatch ¶ added in v1.0.0
func (c *VMController) VMICPUsPatch(vm *virtv1.VirtualMachine, vmi *virtv1.VirtualMachineInstance) error
func (*VMController) VMNodeSelectorPatch ¶ added in v1.1.0
func (c *VMController) VMNodeSelectorPatch(vm *virtv1.VirtualMachine, vmi *virtv1.VirtualMachineInstance) error
type VMIController ¶ added in v0.6.1
type VMIController struct { Queue workqueue.RateLimitingInterface // contains filtered or unexported fields }
func NewVMIController ¶ added in v0.6.1
func NewVMIController(templateService services.TemplateService, vmiInformer cache.SharedIndexInformer, vmInformer cache.SharedIndexInformer, podInformer cache.SharedIndexInformer, pvcInformer cache.SharedIndexInformer, recorder record.EventRecorder, clientset kubecli.KubevirtClient, dataVolumeInformer cache.SharedIndexInformer, cdiInformer cache.SharedIndexInformer, cdiConfigInformer cache.SharedIndexInformer, clusterConfig *virtconfig.ClusterConfig, topologyHinter topology.Hinter, ) (*VMIController, error)
func (*VMIController) Execute ¶ added in v0.6.1
func (c *VMIController) Execute() bool
func (*VMIController) Run ¶ added in v0.6.1
func (c *VMIController) Run(threadiness int, stopCh <-chan struct{})
type VMIReplicaSet ¶ added in v0.6.1
type VMIReplicaSet struct { Queue workqueue.RateLimitingInterface // contains filtered or unexported fields }
func NewVMIReplicaSet ¶ added in v0.6.1
func NewVMIReplicaSet(vmiInformer cache.SharedIndexInformer, vmiRSInformer cache.SharedIndexInformer, recorder record.EventRecorder, clientset kubecli.KubevirtClient, burstReplicas uint) (*VMIReplicaSet, error)
func (*VMIReplicaSet) Execute ¶ added in v0.6.1
func (c *VMIReplicaSet) Execute() bool
func (*VMIReplicaSet) Run ¶ added in v0.6.1
func (c *VMIReplicaSet) Run(threadiness int, stopCh <-chan struct{})
type VirtControllerApp ¶
type VirtControllerApp struct { service.ServiceListen LeaderElection leaderelectionconfig.Configuration // contains filtered or unexported fields }
func (*VirtControllerApp) AddFlags ¶ added in v0.1.0
func (vca *VirtControllerApp) AddFlags()
func (*VirtControllerApp) Run ¶
func (vca *VirtControllerApp) Run()
type VirtualMachineRevisionData ¶ added in v1.0.0
type VirtualMachineRevisionData struct {
Spec virtv1.VirtualMachineSpec `json:"spec"`
}
Follows the template used in createVMRevision for the Data.Raw value