controllers

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResticPassword      = "RESTIC_PASSWORD"
	ResticRepository    = "RESTIC_REPOSITORY"
	ResticCustomCAKey   = "RESTIC_CUSTOM_CA"
	ResticsecretName    = "dm-credential"
	ResticPruneInterval = "restic-prune-interval"

	DataMoverDummyPodImageEnvVar = "DATA_MOVER_DUMMY_POD_IMAGE"

	// batchNumbers vars
	DefaultConcurrentBackupVolumes  = "10"
	DefaultConcurrentRestoreVolumes = "10"
	DataMoverConcurrentBackup       = "DATAMOVER_CONCURRENT_BACKUP"
	DataMoverConcurrentRestore      = "DATAMOVER_CONCURRENT_RESTORE"

	// AWS vars
	AWSAccessKey     = "AWS_ACCESS_KEY_ID"
	AWSSecretKey     = "AWS_SECRET_ACCESS_KEY"
	AWSDefaultRegion = "AWS_DEFAULT_REGION"

	// Azure vars
	AzureAccountName = "AZURE_ACCOUNT_NAME"
	AzureAccountKey  = "AZURE_ACCOUNT_KEY"
	// GCP vars
	GoogleApplicationCredentials = "GOOGLE_APPLICATION_CREDENTIALS"

	// RetainPolicy parameters
	SnapshotRetainPolicyHourly  = "SnapshotRetainPolicyHourly"
	SnapshotRetainPolicyDaily   = "SnapshotRetainPolicyDaily"
	SnapshotRetainPolicyWeekly  = "SnapshotRetainPolicyWeekly"
	SnapshotRetainPolicyMonthly = "SnapshotRetainPolicyMonthly"
	SnapshotRetainPolicyYearly  = "SnapshotRetainPolicyYearly"
	SnapshotRetainPolicyWithin  = "SnapshotRetainPolicyWithin"
)
View Source
const (
	// AWS registry env vars
	RegistryStorageEnvVarKey                 = "REGISTRY_STORAGE"
	RegistryStorageS3AccesskeyEnvVarKey      = "REGISTRY_STORAGE_S3_ACCESSKEY"
	RegistryStorageS3BucketEnvVarKey         = "REGISTRY_STORAGE_S3_BUCKET"
	RegistryStorageS3RegionEnvVarKey         = "REGISTRY_STORAGE_S3_REGION"
	RegistryStorageS3SecretkeyEnvVarKey      = "REGISTRY_STORAGE_S3_SECRETKEY"
	RegistryStorageS3RegionendpointEnvVarKey = "REGISTRY_STORAGE_S3_REGIONENDPOINT"
	RegistryStorageS3RootdirectoryEnvVarKey  = "REGISTRY_STORAGE_S3_ROOTDIRECTORY"
	RegistryStorageS3SkipverifyEnvVarKey     = "REGISTRY_STORAGE_S3_SKIPVERIFY"
	// Azure registry env vars
	RegistryStorageAzureContainerEnvVarKey       = "REGISTRY_STORAGE_AZURE_CONTAINER"
	RegistryStorageAzureAccountnameEnvVarKey     = "REGISTRY_STORAGE_AZURE_ACCOUNTNAME"
	RegistryStorageAzureAccountkeyEnvVarKey      = "REGISTRY_STORAGE_AZURE_ACCOUNTKEY"
	RegistryStorageAzureSPNClientIDEnvVarKey     = "REGISTRY_STORAGE_AZURE_SPN_CLIENT_ID"
	RegistryStorageAzureSPNClientSecretEnvVarKey = "REGISTRY_STORAGE_AZURE_SPN_CLIENT_SECRET"
	RegistryStorageAzureSPNTenantIDEnvVarKey     = "REGISTRY_STORAGE_AZURE_SPN_TENANT_ID"
	RegistryStorageAzureAADEndpointEnvVarKey     = "REGISTRY_STORAGE_AZURE_AAD_ENDPOINT"
	// GCP registry env vars
	RegistryStorageGCSBucket        = "REGISTRY_STORAGE_GCS_BUCKET"
	RegistryStorageGCSKeyfile       = "REGISTRY_STORAGE_GCS_KEYFILE"
	RegistryStorageGCSRootdirectory = "REGISTRY_STORAGE_GCS_ROOTDIRECTORY"
)

Registry Env var keys

View Source
const (
	S3                    = "s3"
	Azure                 = "azure"
	GCS                   = "gcs"
	AWSProvider           = "aws"
	AzureProvider         = "azure"
	GCPProvider           = "gcp"
	Region                = "region"
	Profile               = "profile"
	S3URL                 = "s3Url"
	S3ForcePathStyle      = "s3ForcePathStyle"
	InsecureSkipTLSVerify = "insecureSkipTLSVerify"
	StorageAccount        = "storageAccount"
	ResourceGroup         = "resourceGroup"
)

provider specific object storage

View Source
const (
	ResticRestoreHelperCM = "restic-restore-action-config"
	HostPods              = "host-pods"
)
View Source
const (
	Server = "server"
	//TODO: Check for default secret names
	VeleroAWSSecretName   = "cloud-credentials"
	VeleroAzureSecretName = "cloud-credentials-azure"
	VeleroGCPSecretName   = "cloud-credentials-gcp"
)
View Source
const (
	AWSProfile            = "profile"
	AWSRegion             = "region"
	CredentialsFileKey    = "credentialsFile"
	EnableSharedConfigKey = "enableSharedConfig"
	GCPSnapshotLocation   = "snapshotLocation"
	GCPProject            = "project"
	AzureApiTimeout       = "apiTimeout"
	AzureSubscriptionId   = "subscriptionId"
	AzureIncremental      = "incremental"
	AzureResourceGroup    = "resourceGroup"
)

provider specific object storage

Variables

This section is empty.

Functions

func ReconcileBatch

func ReconcileBatch(l logr.Logger, reconcileFuncs ...ReconcileFunc) (bool, error)

reconcileBatch steps through a list of reconcile functions until one returns false or an error.

Types

type BucketReconciler added in v0.5.0

type BucketReconciler struct {
	Client        client.Client
	Scheme        *runtime.Scheme
	Log           logr.Logger
	EventRecorder record.EventRecorder
}

VeleroReconciler reconciles a Velero object

func (BucketReconciler) Reconcile added in v0.5.0

func (b BucketReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the Velero object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.9.2/pkg/reconcile

func (*BucketReconciler) SetupWithManager added in v0.5.0

func (b *BucketReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type DPAReconciler added in v0.5.0

type DPAReconciler struct {
	client.Client
	Scheme         *runtime.Scheme
	Log            logr.Logger
	Context        context.Context
	NamespacedName types.NamespacedName
	EventRecorder  record.EventRecorder
}

DPAReconciler reconciles a Velero object

func (*DPAReconciler) LabelVSLSecrets added in v0.5.5

func (r *DPAReconciler) LabelVSLSecrets(log logr.Logger) (bool, error)

func (*DPAReconciler) Reconcile added in v0.5.0

func (r *DPAReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the DataProtectionApplciation object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.9.2/pkg/reconcile

func (*DPAReconciler) ReconcileBackupStorageLocations added in v0.5.0

func (r *DPAReconciler) ReconcileBackupStorageLocations(log logr.Logger) (bool, error)

func (*DPAReconciler) ReconcileDataMoverController added in v1.1.0

func (r *DPAReconciler) ReconcileDataMoverController(log logr.Logger) (bool, error)

func (*DPAReconciler) ReconcileDataMoverResticSecret added in v1.1.0

func (r *DPAReconciler) ReconcileDataMoverResticSecret(log logr.Logger) (bool, error)

func (*DPAReconciler) ReconcileDataMoverVolumeOptions added in v1.2.0

func (r *DPAReconciler) ReconcileDataMoverVolumeOptions(log logr.Logger) (bool, error)

func (*DPAReconciler) ReconcileRegistries added in v0.5.0

func (r *DPAReconciler) ReconcileRegistries(log logr.Logger) (bool, error)

func (*DPAReconciler) ReconcileRegistryRouteConfigs added in v0.5.0

func (r *DPAReconciler) ReconcileRegistryRouteConfigs(log logr.Logger) (bool, error)

func (*DPAReconciler) ReconcileRegistryRoutes added in v0.5.0

func (r *DPAReconciler) ReconcileRegistryRoutes(log logr.Logger) (bool, error)

func (*DPAReconciler) ReconcileRegistrySVCs added in v0.5.0

func (r *DPAReconciler) ReconcileRegistrySVCs(log logr.Logger) (bool, error)

func (*DPAReconciler) ReconcileRegistrySecrets added in v0.5.5

func (r *DPAReconciler) ReconcileRegistrySecrets(log logr.Logger) (bool, error)

Create secret for registry to be parsed by openshift-velero-plugin

func (*DPAReconciler) ReconcileResticDaemonset added in v0.5.0

func (r *DPAReconciler) ReconcileResticDaemonset(log logr.Logger) (bool, error)

func (*DPAReconciler) ReconcileResticRestoreHelperConfig added in v0.5.0

func (r *DPAReconciler) ReconcileResticRestoreHelperConfig(log logr.Logger) (bool, error)

func (*DPAReconciler) ReconcileRestoreResourcesVersionPriority added in v0.5.0

func (r *DPAReconciler) ReconcileRestoreResourcesVersionPriority(dpa *oadpv1alpha1.DataProtectionApplication) (bool, error)

If RestoreResourcesVersionPriority is defined, configmap is created or updated and feature flag for EnableAPIGroupVersions is added to velero

func (*DPAReconciler) ReconcileVeleroDeployment added in v0.5.0

func (r *DPAReconciler) ReconcileVeleroDeployment(log logr.Logger) (bool, error)

func (*DPAReconciler) ReconcileVeleroMetricsSVC added in v0.5.4

func (r *DPAReconciler) ReconcileVeleroMetricsSVC(log logr.Logger) (bool, error)

func (*DPAReconciler) ReconcileVeleroServiceMonitor added in v0.5.4

func (r *DPAReconciler) ReconcileVeleroServiceMonitor(log logr.Logger) (bool, error)

func (*DPAReconciler) ReconcileVolumeSnapshotLocations added in v0.5.0

func (r *DPAReconciler) ReconcileVolumeSnapshotLocations(log logr.Logger) (bool, error)

func (*DPAReconciler) SetupWithManager added in v0.5.0

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

SetupWithManager sets up the controller with the Manager.

func (*DPAReconciler) UpdateCredentialsSecretLabels added in v0.5.5

func (r *DPAReconciler) UpdateCredentialsSecretLabels(secretName string, namespace string, dpaName string) (bool, error)

func (*DPAReconciler) ValidateBackupStorageLocations added in v0.5.0

func (r *DPAReconciler) ValidateBackupStorageLocations(log logr.Logger) (bool, error)

func (*DPAReconciler) ValidateDataProtectionCR added in v0.5.0

func (r *DPAReconciler) ValidateDataProtectionCR(log logr.Logger) (bool, error)

func (*DPAReconciler) ValidateVeleroPlugins added in v0.5.0

func (r *DPAReconciler) ValidateVeleroPlugins(log logr.Logger) (bool, error)

For later: Move this code into validator.go when more need for validation arises TODO: if multiple default plugins exist, ensure we validate all of them. Right now its sequential validation

func (*DPAReconciler) ValidateVolumeSnapshotLocations added in v0.5.0

func (r *DPAReconciler) ValidateVolumeSnapshotLocations(log logr.Logger) (bool, error)

type ReconcileFunc

type ReconcileFunc func(logr.Logger) (bool, error)

Jump to

Keyboard shortcuts

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