Documentation
¶
Overview ¶
Package controller implements the KubeVirt DataMover controller
Index ¶
Constants ¶
View Source
const ( // DefaultMaxConcurrentReconciles is the default number of concurrent reconciles DefaultMaxConcurrentReconciles = 3 // DefaultTempPVCSize is the default size for temporary backup PVC DefaultTempPVCSize = "10Gi" // RequeueAfterShort is the short requeue duration for polling RequeueAfterShort = 5 * time.Second // RequeueAfterLong is the longer requeue duration RequeueAfterLong = 30 * time.Second // AnnotationVMBTName is the annotation key for the generated VMBT name on a DataUpload AnnotationVMBTName = "kubevirt-datamover.io/vmbt-name" )
View Source
const ( // PVRebindTimeout is the maximum time to wait for PV rebinding operations PVRebindTimeout = 2 * time.Minute // PVRebindPollInterval is the interval between polling for PV binding status PVRebindPollInterval = 2 * time.Second // KubeAnnBoundByController is the annotation added by Kubernetes PV controller KubeAnnBoundByController = "pv.kubernetes.io/bound-by-controller" // PatchRetryAttempts is the number of times to retry patch operations PatchRetryAttempts = 3 // PatchRetryInterval is the interval between patch retry attempts PatchRetryInterval = 1 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatamoverPodConfig ¶
type DatamoverPodConfig struct {
// Pod identity
Name string
Namespace string
// Container image
Image string
ImagePullPolicy corev1.PullPolicy
// BSL configuration
BSLProvider string
BSLBucket string
BSLPrefix string
BSLRegion string
// Credentials
CredentialSecretName string
CredentialSecretKey string
// VM context
VMName string
VMNamespace string
// Backup context
CheckpointName string
BackupType string
VeleroBackupName string
DataUploadName string
DataUploadUID string
VMBName string
VMBTName string
// Source PVC
SourcePVCName string
// Labels for pod
Labels map[string]string
}
DatamoverPodConfig contains configuration for building a datamover pod.
type KubeVirtDataUploadReconciler ¶
type KubeVirtDataUploadReconciler struct {
client.Client
Scheme *runtime.Scheme
Log logr.Logger
// OADPNamespace is the namespace where OADP and Velero resources are located
OADPNamespace string
// MaxConcurrentReconciles is the maximum number of concurrent Reconciles which can be run
MaxConcurrentReconciles int
// DatamoverImage is the image to use for datamover pods
DatamoverImage string
// DatamoverImagePullPolicy is the pull policy for the datamover image
DatamoverImagePullPolicy corev1.PullPolicy
// MaxIncrementalBackups is the maximum number of incremental backups per VM
// before forcing a full backup. 0 means unlimited.
MaxIncrementalBackups int
// ObjectStoreFactory creates an ObjectStore from an UploaderConfig.
// Defaults to uploader.InitObjectStore if nil. Override in tests to inject mocks.
ObjectStoreFactory func(cfg *uploader.UploaderConfig) (velero.ObjectStore, error)
}
KubeVirtDataUploadReconciler reconciles DataUpload objects where Spec.DataMover is "kubevirt"
func (*KubeVirtDataUploadReconciler) Reconcile ¶
func (r *KubeVirtDataUploadReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile handles DataUpload resources where Spec.DataMover is "kubevirt"
func (*KubeVirtDataUploadReconciler) SetupWithManager ¶
func (r *KubeVirtDataUploadReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager
type PVRebindResult ¶
type PVRebindResult struct {
// NewPVCName is the name of the new PVC in the target namespace
NewPVCName string
// NewPVCNamespace is the namespace of the new PVC
NewPVCNamespace string
// PVName is the name of the PV that was rebound
PVName string
// OriginalReclaimPolicy is the original reclaim policy (to restore later)
OriginalReclaimPolicy corev1.PersistentVolumeReclaimPolicy
}
PVRebindResult contains the result of a PV rebind operation
Click to show internal directories.
Click to hide internal directories.