controller

package
Version: v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 68 Imported by: 6

Documentation

Index

Constants

View Source
const (
	Backup                = "backup"
	BackupDeletion        = "backup-deletion"
	BackupStorageLocation = "backup-storage-location"
	BackupSync            = "backup-sync"
	DownloadRequest       = "download-request"
	GarbageCollection     = "gc"
	PodVolumeBackup       = "pod-volume-backup"
	PodVolumeRestore      = "pod-volume-restore"
	ResticRepo            = "restic-repo"
	Restore               = "restore"
	Schedule              = "schedule"
	ServerStatusRequest   = "server-status-request"
)
View Source
const (
	GCSyncPeriod = 60 * time.Minute
)

Variables

DisableableControllers is a list of controllers that can be disabled

Functions

func NewScheduleController

func NewScheduleController(
	namespace string,
	schedulesClient velerov1client.SchedulesGetter,
	backupsClient velerov1client.BackupsGetter,
	schedulesInformer velerov1informers.ScheduleInformer,
	logger logrus.FieldLogger,
	metrics *metrics.ServerMetrics,
) *scheduleController

Types

type BackupStorageLocationReconciler added in v1.5.0

type BackupStorageLocationReconciler struct {
	Ctx                       context.Context
	Client                    client.Client
	Scheme                    *runtime.Scheme
	DefaultBackupLocationInfo storage.DefaultBackupLocationInfo
	// use variables to refer to these functions so they can be
	// replaced with fakes for testing.
	NewPluginManager  func(logrus.FieldLogger) clientmgmt.Manager
	BackupStoreGetter persistence.ObjectBackupStoreGetter

	Log logrus.FieldLogger
}

BackupStorageLocationReconciler reconciles a BackupStorageLocation object

func (*BackupStorageLocationReconciler) Reconcile added in v1.5.0

+kubebuilder:rbac:groups=velero.io,resources=backupstoragelocations,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=velero.io,resources=backupstoragelocations/status,verbs=get;update;patch

func (*BackupStorageLocationReconciler) SetupWithManager added in v1.5.0

func (r *BackupStorageLocationReconciler) SetupWithManager(mgr ctrl.Manager) error

type BackupTracker added in v0.8.0

type BackupTracker interface {
	// Add informs the tracker that a backup is in progress.
	Add(ns, name string)
	// Delete informs the tracker that a backup is no longer in progress.
	Delete(ns, name string)
	// Contains returns true if the tracker is tracking the backup.
	Contains(ns, name string) bool
}

BackupTracker keeps track of in-progress backups.

func NewBackupTracker added in v0.8.0

func NewBackupTracker() BackupTracker

NewBackupTracker returns a new BackupTracker.

type DownloadRequestReconciler added in v1.6.0

type DownloadRequestReconciler struct {
	Scheme *runtime.Scheme
	Client kbclient.Client
	Clock  clock.Clock
	// use variables to refer to these functions so they can be
	// replaced with fakes for testing.
	NewPluginManager  func(logrus.FieldLogger) clientmgmt.Manager
	BackupStoreGetter persistence.ObjectBackupStoreGetter

	Log logrus.FieldLogger
}

DownloadRequestReconciler reconciles a DownloadRequest object

func (*DownloadRequestReconciler) Reconcile added in v1.6.0

+kubebuilder:rbac:groups=velero.io,resources=downloadrequests,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=velero.io,resources=downloadrequests/status,verbs=get;update;patch

func (*DownloadRequestReconciler) SetupWithManager added in v1.6.0

func (r *DownloadRequestReconciler) SetupWithManager(mgr ctrl.Manager) error

type Interface

type Interface interface {
	// Run runs the component.
	Run(ctx context.Context, workers int) error
}

Interface represents a runnable component.

func NewBackupController

func NewBackupController(
	backupInformer velerov1informers.BackupInformer,
	client velerov1client.BackupsGetter,
	discoveryHelper discovery.Helper,
	backupper pkgbackup.Backupper,
	logger logrus.FieldLogger,
	backupLogLevel logrus.Level,
	newPluginManager func(logrus.FieldLogger) clientmgmt.Manager,
	backupTracker BackupTracker,
	kbClient kbclient.Client,
	defaultBackupLocation string,
	defaultVolumesToRestic bool,
	defaultBackupTTL time.Duration,
	volumeSnapshotLocationLister velerov1listers.VolumeSnapshotLocationLister,
	defaultSnapshotLocations map[string]string,
	metrics *metrics.ServerMetrics,
	formatFlag logging.Format,
	volumeSnapshotLister snapshotv1beta1listers.VolumeSnapshotLister,
	volumeSnapshotContentLister snapshotv1beta1listers.VolumeSnapshotContentLister,
	backupStoreGetter persistence.ObjectBackupStoreGetter,
) Interface

func NewBackupDeletionController added in v0.8.0

func NewBackupDeletionController(
	logger logrus.FieldLogger,
	deleteBackupRequestInformer velerov1informers.DeleteBackupRequestInformer,
	deleteBackupRequestClient velerov1client.DeleteBackupRequestsGetter,
	backupClient velerov1client.BackupsGetter,
	restoreLister velerov1listers.RestoreLister,
	restoreClient velerov1client.RestoresGetter,
	backupTracker BackupTracker,
	resticMgr restic.RepositoryManager,
	podvolumeBackupLister velerov1listers.PodVolumeBackupLister,
	kbClient client.Client,
	snapshotLocationLister velerov1listers.VolumeSnapshotLocationLister,
	csiSnapshotLister snapshotv1beta1listers.VolumeSnapshotLister,
	csiSnapshotContentLister snapshotv1beta1listers.VolumeSnapshotContentLister,
	csiSnapshotClient *snapshotterClientSet.Clientset,
	newPluginManager func(logrus.FieldLogger) clientmgmt.Manager,
	backupStoreGetter persistence.ObjectBackupStoreGetter,
	metrics *metrics.ServerMetrics,
	helper discovery.Helper,
) Interface

NewBackupDeletionController creates a new backup deletion controller.

func NewBackupSyncController

func NewBackupSyncController(
	backupClient velerov1client.BackupsGetter,
	kbClient client.Client,
	podVolumeBackupClient velerov1client.PodVolumeBackupsGetter,
	backupLister velerov1listers.BackupLister,
	syncPeriod time.Duration,
	namespace string,
	csiSnapshotClient *snapshotterClientSet.Clientset,
	kubeClient kubernetes.Interface,
	defaultBackupLocation string,
	newPluginManager func(logrus.FieldLogger) clientmgmt.Manager,
	backupStoreGetter persistence.ObjectBackupStoreGetter,
	logger logrus.FieldLogger,
) Interface

func NewGCController

func NewGCController(
	logger logrus.FieldLogger,
	backupInformer velerov1informers.BackupInformer,
	deleteBackupRequestLister velerov1listers.DeleteBackupRequestLister,
	deleteBackupRequestClient velerov1client.DeleteBackupRequestsGetter,
	kbClient client.Client,
) Interface

NewGCController constructs a new gcController.

func NewPodVolumeBackupController added in v0.9.0

func NewPodVolumeBackupController(
	logger logrus.FieldLogger,
	podVolumeBackupInformer informers.PodVolumeBackupInformer,
	podVolumeBackupClient velerov1client.PodVolumeBackupsGetter,
	podInformer cache.SharedIndexInformer,
	pvcInformer corev1informers.PersistentVolumeClaimInformer,
	pvInformer corev1informers.PersistentVolumeInformer,
	metrics *metrics.ServerMetrics,
	kbClient client.Client,
	nodeName string,
	credentialsFileStore credentials.FileStore,
) Interface

NewPodVolumeBackupController creates a new pod volume backup controller.

func NewPodVolumeRestoreController added in v0.9.0

func NewPodVolumeRestoreController(
	logger logrus.FieldLogger,
	podVolumeRestoreInformer informers.PodVolumeRestoreInformer,
	podVolumeRestoreClient velerov1client.PodVolumeRestoresGetter,
	podInformer cache.SharedIndexInformer,
	pvcInformer corev1informers.PersistentVolumeClaimInformer,
	pvInformer corev1informers.PersistentVolumeInformer,
	kbClient client.Client,
	nodeName string,
	credentialsFileStore credentials.FileStore,
) Interface

NewPodVolumeRestoreController creates a new pod volume restore controller.

func NewResticRepositoryController added in v0.9.0

func NewResticRepositoryController(
	logger logrus.FieldLogger,
	resticRepositoryInformer velerov1informers.ResticRepositoryInformer,
	resticRepositoryClient velerov1client.ResticRepositoriesGetter,
	kbClient client.Client,
	repositoryManager restic.RepositoryManager,
	defaultMaintenanceFrequency time.Duration,
) Interface

NewResticRepositoryController creates a new restic repository controller.

func NewRestoreController

func NewRestoreController(
	namespace string,
	restoreInformer velerov1informers.RestoreInformer,
	restoreClient velerov1client.RestoresGetter,
	podVolumeBackupClient velerov1client.PodVolumeBackupsGetter,
	restorer pkgrestore.Restorer,
	backupLister velerov1listers.BackupLister,
	kbClient client.Client,
	snapshotLocationLister velerov1listers.VolumeSnapshotLocationLister,
	logger logrus.FieldLogger,
	restoreLogLevel logrus.Level,
	newPluginManager func(logrus.FieldLogger) clientmgmt.Manager,
	backupStoreGetter persistence.ObjectBackupStoreGetter,
	metrics *metrics.ServerMetrics,
	logFormat logging.Format,
) Interface

type PluginLister added in v1.5.1

type PluginLister interface {
	// List returns all PluginIdentifiers for kind.
	List(kind framework.PluginKind) []framework.PluginIdentifier
}

type ServerStatusRequestReconciler added in v1.5.1

type ServerStatusRequestReconciler struct {
	Scheme         *runtime.Scheme
	Client         client.Client
	Ctx            context.Context
	PluginRegistry PluginLister
	Clock          clock.Clock

	Log logrus.FieldLogger
}

ServerStatusRequestReconciler reconciles a ServerStatusRequest object

func (*ServerStatusRequestReconciler) Reconcile added in v1.5.1

+kubebuilder:rbac:groups=velero.io,resources=serverstatusrequests,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=velero.io,resources=serverstatusrequests/status,verbs=get;update;patch

func (*ServerStatusRequestReconciler) SetupWithManager added in v1.5.1

func (r *ServerStatusRequestReconciler) SetupWithManager(mgr ctrl.Manager) error

Jump to

Keyboard shortcuts

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