Documentation
¶
Index ¶
- Constants
- func CheckBackupRepoForRestore(reqCtx intctrlutil.RequestCtx, cli client.Client, restore *dpv1alpha1.Restore) (string, error)
- func EnsureWorkerServiceAccount(reqCtx intctrlutil.RequestCtx, cli client.Client, namespace string, ...) (string, error)
- func FilterParentBackups(backupList *dpv1alpha1.BackupList, targetBackup *dpv1alpha1.Backup, ...) []*dpv1alpha1.Backup
- func FindParentBackupIfNotSet(ctx context.Context, cli client.Client, backup *dpv1alpha1.Backup, ...) (*dpv1alpha1.Backup, error)
- func GetParentBackup(ctx context.Context, cli client.Client, backup *dpv1alpha1.Backup, ...) (*dpv1alpha1.Backup, error)
- func GetTargetPods(reqCtx intctrlutil.RequestCtx, cli client.Client, selectedPodNames []string, ...) ([]*corev1.Pod, error)
- func HandleBackupRepo(request *dpbackup.Request) error
- func PatchBackupObjectMeta(original *dpv1alpha1.Backup, request *dpbackup.Request) (bool, error)
- func RecorderEventAndRequeue(reqCtx intctrlutil.RequestCtx, recorder record.EventRecorder, ...) (reconcile.Result, error)
- func UniversalContext(ctx context.Context, mcMgr multicluster.Manager) context.Context
- func ValidateParentBackup(backup *dpv1alpha1.Backup, parentBackup *dpv1alpha1.Backup, ...) error
- type ActionSetReconciler
- type BackupPolicyReconciler
- type BackupReconciler
- type BackupRepoReconciler
- type BackupScheduleReconciler
- type GCReconciler
- type LogCollectionReconciler
- type RestoreReconciler
- type StorageProviderReconciler
- type VolumePopulatorReconciler
- func (r *VolumePopulatorReconciler) Cleanup(reqCtx intctrlutil.RequestCtx, pvc *corev1.PersistentVolumeClaim) error
- func (r *VolumePopulatorReconciler) ContainPopulatingCondition(pvc *corev1.PersistentVolumeClaim) bool
- func (r *VolumePopulatorReconciler) MatchToPopulate(pvc *corev1.PersistentVolumeClaim) (bool, error)
- func (r *VolumePopulatorReconciler) Populate(reqCtx intctrlutil.RequestCtx, pvc *corev1.PersistentVolumeClaim, ...) error
- func (r *VolumePopulatorReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *VolumePopulatorReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *VolumePopulatorReconciler) UpdatePVCConditions(reqCtx intctrlutil.RequestCtx, pvc *corev1.PersistentVolumeClaim, ...) error
Constants ¶
const ( // event reasons CSIDriverObjectFound = "CSIDriverObjectFound" CheckCSIDriverFailed = "CheckCSIDriverFailed" )
const ( // condition types ConditionTypeStorageProviderReady = "StorageProviderReady" ConditionTypeParametersChecked = "ParametersChecked" ConditionTypeStorageClassCreated = "StorageClassCreated" ConditionTypePVCTemplateChecked = "PVCTemplateChecked" ConditionTypeDerivedObjectsDeleted = "DerivedObjectsDeleted" ConditionTypePreCheckPassed = "PreCheckPassed" // condition reasons ReasonStorageProviderReady = "StorageProviderReady" ReasonStorageProviderNotReady = "StorageProviderNotReady" ReasonStorageProviderNotFound = "StorageProviderNotFound" ReasonInvalidStorageProvider = "InvalidStorageProvider" ReasonParametersChecked = "ParametersChecked" ReasonCredentialSecretNotFound = "CredentialSecretNotFound" ReasonPrepareCSISecretFailed = "PrepareCSISecretFailed" ReasonPrepareStorageClassFailed = "PrepareStorageClassFailed" ReasonBadPVCTemplate = "BadPVCTemplate" ReasonStorageClassCreated = "StorageClassCreated" ReasonPVCTemplateChecked = "PVCTemplateChecked" ReasonHaveAssociatedBackups = "HaveAssociatedBackups" ReasonHaveResidualPVCs = "HaveResidualPVCs" ReasonDerivedObjectsDeleted = "DerivedObjectsDeleted" ReasonPreCheckPassed = "PreCheckPassed" ReasonPreCheckFailed = "PreCheckFailed" ReasonDigestChanged = "DigestChanged" ReasonUnknownError = "UnknownError" ReasonSkipped = "Skipped" )
condition constants
const ( PopulatePodPrefix = "kb-populate" // annotation keys AnnSelectedNode = "volume.kubernetes.io/selected-node" AnnPopulateFrom = "dataprotection.kubeblocks.io/populate-from" // event reason ReasonStartToVolumePopulate = "StartToVolumePopulate" ReasonVolumePopulateSucceed = "VolumePopulateSucceed" ReasonVolumePopulateFailed = "VolumePopulateFailed" // pvc condition type and reason ReasonPopulatingFailed = "Failed" ReasonPopulatingProcessing = "Processing" ReasonPopulatingSucceed = "Succeed" PersistentVolumeClaimPopulating corev1.PersistentVolumeClaimConditionType = "Populating" )
constant for volume populator
Variables ¶
This section is empty.
Functions ¶
func CheckBackupRepoForRestore ¶ added in v0.9.0
func CheckBackupRepoForRestore(reqCtx intctrlutil.RequestCtx, cli client.Client, restore *dpv1alpha1.Restore) (string, error)
func EnsureWorkerServiceAccount ¶ added in v0.9.0
func EnsureWorkerServiceAccount(reqCtx intctrlutil.RequestCtx, cli client.Client, namespace string, mcMgr multicluster.Manager) (string, error)
func FilterParentBackups ¶ added in v0.9.3
func FilterParentBackups(backupList *dpv1alpha1.BackupList, targetBackup *dpv1alpha1.Backup, backupMethod *dpv1alpha1.BackupMethod, incremental bool) []*dpv1alpha1.Backup
FilterParentBackups filters the parent backups by backup phase, backup method and end time.
func FindParentBackupIfNotSet ¶ added in v0.9.3
func FindParentBackupIfNotSet(ctx context.Context, cli client.Client, backup *dpv1alpha1.Backup, backupMethod *dpv1alpha1.BackupMethod, scheduleName string) (*dpv1alpha1.Backup, error)
FindParentBackupIfNotSet finds the latest valid parent backup for the incremental backup. a. return the latest full backup when it is newer than the base backup of the latest incremental backup, or when the base backup of the latest incremental backup is not found. b. return the latest incremental backup. c. return the latest full backup if incremental backups are not found. For scheduled backups, find the parent within scheduled backups, which have the schedule label, if not found, find the full backup as the parent within all backups. For on-demand backups, find the parent within all backups.
func GetParentBackup ¶ added in v0.9.3
func GetParentBackup(ctx context.Context, cli client.Client, backup *dpv1alpha1.Backup, backupMethod *dpv1alpha1.BackupMethod) (*dpv1alpha1.Backup, error)
GetParentBackup returns the parent backup of the backup. If parentBackupName is specified, the backup should be a on-demand backup, then validate and return the parent backup. If parentBackupName is not specified, find the latest valid parent backup.
func GetTargetPods ¶ added in v0.7.1
func GetTargetPods(reqCtx intctrlutil.RequestCtx, cli client.Client, selectedPodNames []string, backupPolicy *dpv1alpha1.BackupPolicy, target *dpv1alpha1.BackupTarget, backupType dpv1alpha1.BackupType) ([]*corev1.Pod, error)
GetTargetPods gets the target pods by BackupPolicy. If podName is not empty, it will return the pod which name is podName. Otherwise, it will return the pods which are selected by BackupPolicy selector and strategy.
func HandleBackupRepo ¶ added in v0.7.1
func PatchBackupObjectMeta ¶ added in v0.7.1
PatchBackupObjectMeta patches backup object metaObject include cluster snapshot.
func RecorderEventAndRequeue ¶ added in v0.7.1
func RecorderEventAndRequeue(reqCtx intctrlutil.RequestCtx, recorder record.EventRecorder, obj client.Object, err error) (reconcile.Result, error)
func UniversalContext ¶ added in v0.9.0
func ValidateParentBackup ¶ added in v0.9.3
func ValidateParentBackup(backup *dpv1alpha1.Backup, parentBackup *dpv1alpha1.Backup, backupMethod *dpv1alpha1.BackupMethod) error
ValidateParentBackup validates the parent backup.
Types ¶
type ActionSetReconciler ¶ added in v0.7.0
type ActionSetReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder }
ActionSetReconciler reconciles a ActionSet object
func (*ActionSetReconciler) Reconcile ¶ added in v0.7.0
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the actionset closer to the desired state.
func (*ActionSetReconciler) SetupWithManager ¶ added in v0.7.0
func (r *ActionSetReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type BackupPolicyReconciler ¶
type BackupPolicyReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder }
BackupPolicyReconciler reconciles a BackupPolicy object
func (*BackupPolicyReconciler) Reconcile ¶
func (r *BackupPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the backuppolicy closer to the desired state.
func (*BackupPolicyReconciler) SetupWithManager ¶
func (r *BackupPolicyReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type BackupReconciler ¶
type BackupReconciler struct { client.Client Scheme *k8sruntime.Scheme Recorder record.EventRecorder RestConfig *rest.Config // contains filtered or unexported fields }
BackupReconciler reconciles a Backup object
func (*BackupReconciler) Reconcile ¶
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the backup closer to the desired state.
func (*BackupReconciler) SetupWithManager ¶
func (r *BackupReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type BackupRepoReconciler ¶ added in v0.6.0
type BackupRepoReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder RestConfig *rest.Config MultiClusterMgr multicluster.Manager // contains filtered or unexported fields }
BackupRepoReconciler reconciles a BackupRepo object
func (*BackupRepoReconciler) Reconcile ¶ added in v0.6.0
func (r *BackupRepoReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (*BackupRepoReconciler) SetupWithManager ¶ added in v0.6.0
func (r *BackupRepoReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type BackupScheduleReconciler ¶ added in v0.7.0
type BackupScheduleReconciler struct { client.Client Scheme *k8sruntime.Scheme Recorder record.EventRecorder }
BackupScheduleReconciler reconciles a BackupSchedule object
func (*BackupScheduleReconciler) Reconcile ¶ added in v0.7.0
func (r *BackupScheduleReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the backupschedule closer to the desired state.
func (*BackupScheduleReconciler) SetupWithManager ¶ added in v0.7.0
func (r *BackupScheduleReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type GCReconciler ¶ added in v0.7.0
type GCReconciler struct { client.Client Recorder record.EventRecorder // contains filtered or unexported fields }
GCReconciler garbage collection reconciler, which periodically deletes expired backups.
func NewGCReconciler ¶ added in v0.7.0
func NewGCReconciler(mgr ctrl.Manager) *GCReconciler
func (*GCReconciler) Reconcile ¶ added in v0.7.0
Reconcile is part of the main kubernetes reconciliation loop which aims to delete expired backups.
func (*GCReconciler) SetupWithManager ¶ added in v0.7.0
func (r *GCReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the GCReconciler using the supplied manager. GCController only watches on CreateEvent for ensuring every new backup will be taken care of. Other events will be filtered to decrease the load on the controller.
type LogCollectionReconciler ¶ added in v0.8.2
type LogCollectionReconciler struct { client.Client Scheme *k8sruntime.Scheme Recorder record.EventRecorder RestConfig *rest.Config }
LogCollectionReconciler reconciles a job of the backup and restore to collect the failed message.
func (*LogCollectionReconciler) Reconcile ¶ added in v0.8.2
func (r *LogCollectionReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the backup closer to the desired state.
func (*LogCollectionReconciler) SetupWithManager ¶ added in v0.8.2
func (r *LogCollectionReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type RestoreReconciler ¶ added in v0.7.0
type RestoreReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder }
RestoreReconciler reconciles a Restore object
func (*RestoreReconciler) HandleRestoreActions ¶ added in v0.7.1
func (r *RestoreReconciler) HandleRestoreActions(reqCtx intctrlutil.RequestCtx, restoreMgr *dprestore.RestoreManager) error
func (*RestoreReconciler) SetupWithManager ¶ added in v0.7.0
func (r *RestoreReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type StorageProviderReconciler ¶ added in v0.9.0
type StorageProviderReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder MultiClusterMgr multicluster.Manager // contains filtered or unexported fields }
StorageProviderReconciler reconciles a StorageProvider object
func (*StorageProviderReconciler) Reconcile ¶ added in v0.9.0
func (r *StorageProviderReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (*StorageProviderReconciler) SetupWithManager ¶ added in v0.9.0
func (r *StorageProviderReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type VolumePopulatorReconciler ¶ added in v0.7.0
type VolumePopulatorReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder }
VolumePopulatorReconciler reconciles a Restore object
func (*VolumePopulatorReconciler) Cleanup ¶ added in v0.7.1
func (r *VolumePopulatorReconciler) Cleanup(reqCtx intctrlutil.RequestCtx, pvc *corev1.PersistentVolumeClaim) error
func (*VolumePopulatorReconciler) ContainPopulatingCondition ¶ added in v0.7.1
func (r *VolumePopulatorReconciler) ContainPopulatingCondition(pvc *corev1.PersistentVolumeClaim) bool
func (*VolumePopulatorReconciler) MatchToPopulate ¶ added in v0.7.1
func (r *VolumePopulatorReconciler) MatchToPopulate(pvc *corev1.PersistentVolumeClaim) (bool, error)
func (*VolumePopulatorReconciler) Populate ¶ added in v0.7.1
func (r *VolumePopulatorReconciler) Populate(reqCtx intctrlutil.RequestCtx, pvc *corev1.PersistentVolumeClaim, restoreMgr *dprestore.RestoreManager) error
func (*VolumePopulatorReconciler) Reconcile ¶ added in v0.7.0
func (r *VolumePopulatorReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.0/pkg/reconcile
func (*VolumePopulatorReconciler) SetupWithManager ¶ added in v0.7.0
func (r *VolumePopulatorReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
func (*VolumePopulatorReconciler) UpdatePVCConditions ¶ added in v0.7.1
func (r *VolumePopulatorReconciler) UpdatePVCConditions(reqCtx intctrlutil.RequestCtx, pvc *corev1.PersistentVolumeClaim, reason, message string) error