controllers

package
v0.0.0-...-12da84f Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VSBLabel = "datamover.oadp.openshift.io/vsb"
	VSRLabel = "datamover.oadp.openshift.io/vsr"

	DummyPodImage = "quay.io/konveyor/rsync-transfer:latest"

	OADPBSLProviderName = "openshift.io/oadp-bsl-provider"
)
View Source
const (
	// 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"

	// Restic repo vars
	ResticCustomCA      = "RESTIC_CUSTOM_CA"
	ResticPassword      = "RESTIC_PASSWORD"
	ResticRepository    = "RESTIC_REPOSITORY"
	ResticPruneInterval = "restic-prune-interval"

	// Datamover annotation keys
	DatamoverResticRepository = "datamover.io/restic-repository"
	DatamoverSourcePVCName    = "datamover.io/source-pvc-name"
	DatamoverSourcePVCSize    = "datamover.io/source-pvc-size"

	// Providers
	AWSProvider   = "aws"
	AzureProvider = "azure"
	GCPProvider   = "gcp"
)

Restic secret data keys

View Source
const (
	// replicationSource values
	SourceStorageClassName      = "SourceStorageClassName"
	SourceAccessMoce            = "SourceAccessMode"
	SourceCacheStorageClassName = "SourceCacheStorageClassName"
	SourceCacheAccessMoce       = "SourceCacheAccessMode"
	SourceCacheCapacity         = "SourceCacheCapacity"
	SourceCacheAccessMode       = "SourceCacheAccessMode"
	SourceMoverSecurityContext  = "SourceMoverSecurityContext"

	// replicationDestination values
	DestinationStorageClassName      = "DestinationStorageClassName"
	DestinationAccessMoce            = "DestinationAccessMode"
	DestinationCacheStorageClassName = "DestinationCacheStorageClassName"
	DestinationCacheAccessMoce       = "DestinationCacheAccessMode"
	DestinationCacheCapacity         = "DestinationCacheCapacity"
	DestinationCacheAccessMode       = "DestinationCacheAccessMode"
	DestinationMoverSecurityContext  = "DestinationMoverSecurityContext"

	// RetainPolicy parameters
	SnapshotRetainPolicyHourly  = "SnapshotRetainPolicyHourly"
	SnapshotRetainPolicyDaily   = "SnapshotRetainPolicyDaily"
	SnapshotRetainPolicyWeekly  = "SnapshotRetainPolicyWeekly"
	SnapshotRetainPolicyMonthly = "SnapshotRetainPolicyMonthly"
	SnapshotRetainPolicyYearly  = "SnapshotRetainPolicyYearly"
	SnapshotRetainPolicyWithin  = "SnapshotRetainPolicyWithin"

	// Snapshot retain schedule trigger value
	SnapshotScheduleCron = "SnapshotScheduleCron"
)

VSM configmap values

View Source
const (

	// VolumeSnapshotMover annotation keys
	SnapMoverResticRepository = "datamover.io/restic-repository"
	SnapMoverSourcePVCName    = "datamover.io/source-pvc-name"
	SnapMoverSourcePVCSize    = "datamover.io/source-pvc-size"
)

Restic secret data keys

View Source
const ConditionReconciled = "Reconciled"
View Source
const ReconcileCompleteMessage = "Reconcile complete"
View Source
const ReconciledReasonComplete = "Complete"
View Source
const ReconciledReasonError = "Error"

Variables

View Source
var (
	AWSAccessValue        []byte
	AWSSecretValue        []byte
	AWSDefaultRegionValue []byte

	AzureAccountNameValue []byte
	AzureAccountKeyValue  []byte

	GoogleApplicationCredentialsValue []byte

	ResticCustomCAValue      []byte
	ResticPasswordValue      []byte
	ResticRepoValue          string
	ResticPruneIntervalValue []byte
)

Restic secret vars to create new secrets

View Source
var VSBBatchNumber = 0
View Source
var VSRBatchNumber = 0

Functions

func BuildResticSecret

func BuildResticSecret(givensecret *corev1.Secret, secret *corev1.Secret, resticrepo, pruneInterval string, rpolicy *RetainPolicy, scheduleCronExpr string) error

func GetBackupBatchValue

func GetBackupBatchValue(namespace string, client client.Client) (string, error)

func GetDataMoverConfigMap

func GetDataMoverConfigMap(namespace string, sc string, log logr.Logger, client client.Client) (*corev1.ConfigMap, error)

func GetPodSecurityContext

func GetPodSecurityContext(namespace string, sourcePVCName string, c client.Client) (*corev1.PodSecurityContext, error)

func GetRestoreBatchValue

func GetRestoreBatchValue(namespace string, client client.Client) (string, error)

func GetVeleroServiceAccount

func GetVeleroServiceAccount(namespace string, client client.Client) (*corev1.ServiceAccount, error)

func PopulateResticSecret

func PopulateResticSecret(name string, namespace string, label string) (*corev1.Secret, error)

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.

func ValidateResticSecret

func ValidateResticSecret(resticsecret *corev1.Secret) error

Types

type ReconcileFunc

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

type RetainPolicy

type RetainPolicy struct {
	// contains filtered or unexported fields
}

type VolumeSnapshotBackupReconciler

type VolumeSnapshotBackupReconciler struct {
	client.Client
	Scheme         *runtime.Scheme
	Log            logr.Logger
	Context        context.Context
	NamespacedName types.NamespacedName
	EventRecorder  record.EventRecorder
	// contains filtered or unexported fields
}

VolumeSnapshotBackupReconciler reconciles a VolumeSnapshotBackup object

func (*VolumeSnapshotBackupReconciler) BindPVCToDummyPod

func (r *VolumeSnapshotBackupReconciler) BindPVCToDummyPod(log logr.Logger) (bool, error)

func (*VolumeSnapshotBackupReconciler) CleanBackupResources

func (r *VolumeSnapshotBackupReconciler) CleanBackupResources(log logr.Logger) (bool, error)

func (*VolumeSnapshotBackupReconciler) CreateReplicationSource

func (r *VolumeSnapshotBackupReconciler) CreateReplicationSource(log logr.Logger) (bool, error)

func (*VolumeSnapshotBackupReconciler) CreateVSBResticSecret

func (r *VolumeSnapshotBackupReconciler) CreateVSBResticSecret(log logr.Logger) (bool, error)

func (*VolumeSnapshotBackupReconciler) IsPVCBound

func (r *VolumeSnapshotBackupReconciler) IsPVCBound(log logr.Logger) (bool, error)

func (*VolumeSnapshotBackupReconciler) MirrorPVC

func (r *VolumeSnapshotBackupReconciler) MirrorPVC(log logr.Logger) (bool, error)

func (*VolumeSnapshotBackupReconciler) MirrorVolumeSnapshot

func (r *VolumeSnapshotBackupReconciler) MirrorVolumeSnapshot(log logr.Logger) (bool, error)

func (*VolumeSnapshotBackupReconciler) MirrorVolumeSnapshotContent

func (r *VolumeSnapshotBackupReconciler) MirrorVolumeSnapshotContent(log logr.Logger) (bool, error)

func (*VolumeSnapshotBackupReconciler) Reconcile

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 VolumeSnapshotBackup 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.11.0/pkg/reconcile

func (*VolumeSnapshotBackupReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*VolumeSnapshotBackupReconciler) ValidateVolumeSnapshotMoverBackup

func (r *VolumeSnapshotBackupReconciler) ValidateVolumeSnapshotMoverBackup(log logr.Logger) (bool, error)

func (*VolumeSnapshotBackupReconciler) WaitForClonedVolumeSnapshotContentToBeReady

func (r *VolumeSnapshotBackupReconciler) WaitForClonedVolumeSnapshotContentToBeReady(log logr.Logger) (bool, error)

func (*VolumeSnapshotBackupReconciler) WaitForClonedVolumeSnapshotToBeReady

func (r *VolumeSnapshotBackupReconciler) WaitForClonedVolumeSnapshotToBeReady(log logr.Logger) (bool, error)

type VolumeSnapshotRestoreReconciler

type VolumeSnapshotRestoreReconciler struct {
	client.Client
	Scheme         *runtime.Scheme
	Log            logr.Logger
	Context        context.Context
	NamespacedName types.NamespacedName
	EventRecorder  record.EventRecorder
	// contains filtered or unexported fields
}

VolumeSnapshotRestoreReconciler reconciles a VolumeSnapshotRestore object

func (*VolumeSnapshotRestoreReconciler) CleanRestoreResources

func (r *VolumeSnapshotRestoreReconciler) CleanRestoreResources(log logr.Logger) (bool, error)

func (*VolumeSnapshotRestoreReconciler) CreateReplicationDestination

func (r *VolumeSnapshotRestoreReconciler) CreateReplicationDestination(log logr.Logger) (bool, error)

func (*VolumeSnapshotRestoreReconciler) CreateVSRResticSecret

func (r *VolumeSnapshotRestoreReconciler) CreateVSRResticSecret(log logr.Logger) (bool, error)

func (*VolumeSnapshotRestoreReconciler) Reconcile

func (*VolumeSnapshotRestoreReconciler) SetVSRStatus

func (r *VolumeSnapshotRestoreReconciler) SetVSRStatus(log logr.Logger) (bool, error)

func (*VolumeSnapshotRestoreReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*VolumeSnapshotRestoreReconciler) ValidateVolumeSnapshotMoverRestore

func (r *VolumeSnapshotRestoreReconciler) ValidateVolumeSnapshotMoverRestore(log logr.Logger) (bool, error)

func (*VolumeSnapshotRestoreReconciler) WaitForVolSyncSnapshotContentToBeReady

func (r *VolumeSnapshotRestoreReconciler) WaitForVolSyncSnapshotContentToBeReady(log logr.Logger) (bool, error)

Jump to

Keyboard shortcuts

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