Documentation ¶
Index ¶
- Constants
- Variables
- func AvailableS3Profiles(drClusters []rmn.DRCluster) []string
- func ConfigMapGet(ctx context.Context, apiReader client.Reader) (configMap *corev1.ConfigMap, ramenConfig *ramendrv1alpha1.RamenConfig, ...)
- func ConfigMapNew(namespaceName string, name string, ramenConfig *ramendrv1alpha1.RamenConfig) (*corev1.ConfigMap, error)
- func ConvertToPlacement(placementObj interface{}) *clrapiv1beta1.Placement
- func ConvertToPlacementRule(placementObj interface{}) *plrv1.PlacementRule
- func DRClusterPredicateFunc() predicate.Funcs
- func DRClusterUpdateOfInterest(oldDRCluster, newDRCluster *rmn.DRCluster) bool
- func DRPCUpdateOfInterest(oldDRPC, newDRPC *ramen.DRPlacementControl) bool
- func DRPCsFailingOverToClusterForPolicy(k8sclient client.Client, log logr.Logger, drpolicy *rmn.DRPolicy, ...) ([]*rmn.DRPlacementControl, error)
- func DRPCsUsingDRPolicy(k8sclient client.Client, log logr.Logger, drpolicy *rmn.DRPolicy) ([]*rmn.DRPlacementControl, error)
- func DRPolicyPredicateFunc() predicate.Funcs
- func DRPolicySyncIntervalMetricLabels(drPolicy *rmn.DRPolicy) prometheus.Labels
- func DeleteDRPolicySyncIntervalMetrics(labels prometheus.Labels) bool
- func DeleteSyncDataBytesMetric(labels prometheus.Labels) bool
- func DeleteSyncDurationMetric(labels prometheus.Labels) bool
- func DeleteSyncTimeMetric(labels prometheus.Labels) bool
- func DeleteTypedObject(s ObjectStorer, keyPrefix, keySuffix string, object interface{}) error
- func DeleteWorkloadProtectionStatusMetric(labels prometheus.Labels) bool
- func DownloadTypedObject(s ObjectStorer, keyPrefix, keySuffix string, objectPointer interface{}) error
- func DownloadTypedObjects(s ObjectStorer, keyPrefix string, objectsPointer interface{}) error
- func DownloadVRGs(s ObjectStorer, pvKeyPrefix string) (vrgList []ramen.VolumeReplicationGroup, err error)
- func FindProtectedPVC(vrg *ramen.VolumeReplicationGroup, pvcNamespaceName, pvcName string) *ramen.ProtectedPVC
- func FindProtectedPvcAndIndex(vrg *ramen.VolumeReplicationGroup, pvcNamespaceName, pvcName string) (*ramen.ProtectedPVC, int)
- func GetAvailableS3Profiles(ctx context.Context, client client.Client, drpc *rmn.DRPlacementControl, ...) []string
- func GetDRClusters(ctx context.Context, client client.Client, drPolicy *rmn.DRPolicy) ([]rmn.DRCluster, error)
- func GetDRPolicy(ctx context.Context, client client.Client, drpc *rmn.DRPlacementControl, ...) (*rmn.DRPolicy, error)
- func GetLastKnownVRGPrimaryFromS3(ctx context.Context, apiReader client.Reader, s3ProfileNames []string, ...) *rmn.VolumeReplicationGroup
- func GetRamenConfigS3StoreProfile(ctx context.Context, apiReader client.Reader, profileName string) (s3StoreProfile ramendrv1alpha1.S3StoreProfile, err error)
- func GetS3Secret(ctx context.Context, r client.Reader, secretRef corev1.SecretReference) (s3AccessID, s3SecretAccessKey []byte, err error)
- func IsPreRelocateProgression(status rmn.ProgressionStatus) bool
- func LoadControllerConfig(configFile string, log logr.Logger) (ramenConfig *ramendrv1alpha1.RamenConfig)
- func LoadControllerOptions(options *ctrl.Options, ramenConfig *ramendrv1alpha1.RamenConfig)
- func MModesFromCSV(modes string) []ramendrv1alpha1.MMode
- func ManagedClusterViewPredicateFunc() predicate.Funcs
- func ManifestWorkPredicateFunc() predicate.Funcs
- func ParseDoubleSlash(input string) string
- func ParseRemoveSlashes(input string) string
- func ParseSingleSlash(input string) string
- func PlacementPredicateFunc() predicate.Funcs
- func PlacementRulePredicateFunc() predicate.Funcs
- func PruneAnnotations(annotations map[string]string) map[string]string
- func RamenConfigS3StoreProfilePointerGet(ramenConfig *ramendrv1alpha1.RamenConfig, profileName string) *ramendrv1alpha1.S3StoreProfile
- func RamenOperandsNamespace(config ramendrv1alpha1.RamenConfig) string
- func RamenOperatorNamespace() string
- func ReadRamenConfigFile(log logr.Logger) (ramenConfig *ramendrv1alpha1.RamenConfig, err error)
- func RecipeElementsGet(ctx context.Context, reader client.Reader, vrg ramen.VolumeReplicationGroup, ...) error
- func RecipeParametersExpand(recipe *recipe.Recipe, parameters map[string][]string, log logr.Logger) error
- func RequiresDRPCReconciliation(oldDRPolicy, newDRPolicy *rmn.DRPolicy) bool
- func S3KeyPrefix(namespacedName string) string
- func SubscriptionFromDrClusterManifestWork(mwu *util.MWUtil, clusterName string) (*operatorsv1alpha1.Subscription, error)
- func SyncDataBytesMetricLabels(drPolicy *rmn.DRPolicy, drpc *rmn.DRPlacementControl) prometheus.Labels
- func SyncDurationMetricLabels(drPolicy *rmn.DRPolicy, drpc *rmn.DRPlacementControl) prometheus.Labels
- func SyncTimeMetricLabels(drPolicy *rmn.DRPolicy, drpc *rmn.DRPlacementControl) prometheus.Labels
- func TypedObjectKey(prefix, suffix string, object interface{}) string
- func UploadPV(s ObjectStorer, pvKeyPrefix, pvKeySuffix string, pv corev1.PersistentVolume) error
- func UploadPVC(s ObjectStorer, pvcKeyPrefix, pvcKeySuffix string, ...) error
- func VrgObjectProtect(objectStorer ObjectStorer, vrg ramen.VolumeReplicationGroup) error
- func VrgObjectUnprotect(objectStorer ObjectStorer, vrg ramen.VolumeReplicationGroup) error
- func VrgTidyForList(vrg *ramendrv1alpha1.VolumeReplicationGroup)
- func WorkloadProtectionStatusLabels(drpc *rmn.DRPlacementControl) prometheus.Labels
- type DRClusterConfigReconciler
- func (r *DRClusterConfigReconciler) CreateClassClaims(ctx context.Context, log logr.Logger) ([]string, error)
- func (r *DRClusterConfigReconciler) GetDRClusterConfig(ctx context.Context) (*ramen.DRClusterConfig, error)
- func (r *DRClusterConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *DRClusterConfigReconciler) SetupWithManager(mgr ctrl.Manager) error
- type DRClusterReconciler
- type DRPCAndPolicy
- type DRPCInstance
- func (d *DRPCInstance) EnsureCleanup(clusterToSkip string) error
- func (d *DRPCInstance) EnsureSecondaryReplicationSetup(srcCluster string) error
- func (d *DRPCInstance) EnsureVolSyncReplicationSetup(srcCluster string) error
- func (d *DRPCInstance) IsVolSyncReplicationRequired(homeCluster string) (bool, error)
- func (d *DRPCInstance) ResetVolSyncRDOnPrimary(clusterName string) error
- func (d *DRPCInstance) RunFailover() (bool, error)
- func (d *DRPCInstance) RunInitialDeployment() (bool, error)
- func (d *DRPCInstance) RunRelocate() (bool, error)
- type DRPlacementControlReconciler
- func (r *DRPlacementControlReconciler) FilterDRCluster(drcluster *rmn.DRCluster) []ctrl.Request
- func (r *DRPlacementControlReconciler) FilterDRPCsForDRPolicyUpdate(drpolicy *rmn.DRPolicy) []ctrl.Request
- func (r *DRPlacementControlReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *DRPlacementControlReconciler) SetupWithManager(mgr ctrl.Manager) error
- type DRPolicyReconciler
- type DRPolicySyncMetrics
- type DRType
- type ObjectStoreGetter
- type ObjectStorer
- type Progress
- type ProgressCallback
- type ProtectedVolumeReplicationGroupListInstance
- func (s *ProtectedVolumeReplicationGroupListInstance) GetItemsInReplicaStoreWithPrefix(s3ProfileName string, lookupPrefix string) ([]string, error)
- func (s *ProtectedVolumeReplicationGroupListInstance) ParseResultListFromReplicaStore(s3ProfileName string, prefix string, parseFunc func(string) string) ([]string, error)
- type ProtectedVolumeReplicationGroupListReconciler
- type PvcSelector
- type RecipeElements
- type ReplicationGroupDestinationReconciler
- type ReplicationGroupSourceReconciler
- type SyncDataBytesMetrics
- type SyncDurationMetrics
- type SyncMetrics
- type SyncTimeMetrics
- type VRGInstance
- func (v *VRGInstance) UploadPVAndPVCtoS3(s3ProfileName string, objectStore ObjectStorer, pv *corev1.PersistentVolume, ...) error
- func (v *VRGInstance) UploadPVandPVCtoS3Store(s3ProfileName string, pvc *corev1.PersistentVolumeClaim) error
- func (v *VRGInstance) UploadPVandPVCtoS3Stores(pvc *corev1.PersistentVolumeClaim, log logr.Logger) ([]string, error)
- type VolumeReplicationGroupReconciler
- func (r *VolumeReplicationGroupReconciler) RDMapFunc(ctx context.Context, obj client.Object) []reconcile.Request
- func (r *VolumeReplicationGroupReconciler) RSMapFunc(ctx context.Context, obj client.Object) []reconcile.Request
- func (r *VolumeReplicationGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *VolumeReplicationGroupReconciler) SetupWithManager(mgr ctrl.Manager, ramenConfig *ramendrv1alpha1.RamenConfig) error
- func (r *VolumeReplicationGroupReconciler) VRMapFunc(ctx context.Context, obj client.Object) []reconcile.Request
- type WorkloadProtectionMetrics
Constants ¶
const ( DRClusterConditionReasonInitializing = "Initializing" DRClusterConditionReasonFencing = "Fencing" DRClusterConditionReasonUnfencing = "Unfencing" DRClusterConditionReasonCleaning = "Cleaning" DRClusterConditionReasonFenced = "Fenced" DRClusterConditionReasonUnfenced = "Unfenced" DRClusterConditionReasonClean = "Clean" DRClusterConditionReasonValidated = "Succeeded" DRClusterConditionReasonFenceError = "FenceError" DRClusterConditionReasonUnfenceError = "UnfenceError" DRClusterConditionReasonCleanError = "CleanError" DRClusterConditionReasonError = "Error" DRClusterConditionReasonErrorUnknown = "UnknownError" )
DRCluster condition reasons
const ( StorageAnnotationSecretName = "drcluster.ramendr.openshift.io/storage-secret-name" StorageAnnotationSecretNamespace = "drcluster.ramendr.openshift.io/storage-secret-namespace" StorageAnnotationClusterID = "drcluster.ramendr.openshift.io/storage-clusterid" StorageAnnotationDriver = "drcluster.ramendr.openshift.io/storage-driver" )
const ( // Annotations for MW and PlacementRule DRPCNameAnnotation = "drplacementcontrol.ramendr.openshift.io/drpc-name" DRPCNamespaceAnnotation = "drplacementcontrol.ramendr.openshift.io/drpc-namespace" // Annotation that stores the UID of DRPC that created the resource on the managed cluster using a ManifestWork DRPCUIDAnnotation = "drplacementcontrol.ramendr.openshift.io/drpc-uid" // Annotation for the last cluster on which the application was running LastAppDeploymentCluster = "drplacementcontrol.ramendr.openshift.io/last-app-deployment-cluster" // Annotation for application namespace on the managed cluster DRPCAppNamespace = "drplacementcontrol.ramendr.openshift.io/app-namespace" )
const ( DRTypeSync = DRType("sync") DRTypeAsync = DRType("async") )
const ( // DRPC CR finalizer DRPCFinalizer string = "drpc.ramendr.openshift.io/finalizer" // Ramen scheduler RamenScheduler string = "ramen" ClonedPlacementRuleNameFormat string = "drpc-plrule-%s-%s" // StatusCheckDelay is used to frequencly update the DRPC status when the reconciler is idle. // This is needed in order to sync up the DRPC status and the VRG status. StatusCheckDelay = time.Minute * 10 // PlacementDecisionName format, prefix is the Placement name, and suffix is a PlacementDecision index PlacementDecisionName = "%s-decision-%d" // Maximum retries to create PlacementDecisionName with an increasing index in case of conflicts // with existing PlacementDecision resources MaxPlacementDecisionConflictCount = 5 DestinationClusterAnnotationKey = "drplacementcontrol.ramendr.openshift.io/destination-cluster" DoNotDeletePVCAnnotation = "drplacementcontrol.ramendr.openshift.io/do-not-delete-pvc" DoNotDeletePVCAnnotationVal = "true" )
const ( Continue = 1 AllowFailover = 2 Stop = 3 )
const ( LastSyncTimestampSeconds = "last_sync_timestamp_seconds" LastSyncDurationSeconds = "last_sync_duration_seconds" LastSyncDataBytes = "last_sync_data_bytes" WorkloadProtectionStatus = "workload_protection_status" )
const ( ObjType = "obj_type" ObjName = "obj_name" ObjNamespace = "obj_namespace" Policyname = "policyname" SchedulingInterval = "scheduling_interval" )
const ( HubOperatorConfigMapName = hubOperatorNameDefault + configMapNameSuffix DrClusterOperatorConfigMapName = drClusterOperatorNameDefault + configMapNameSuffix HubLeaderElectionResourceName = hubName + leaderElectionResourceNameSuffix ConfigMapRamenConfigKeyName = "ramen_manager_config.yaml" DefaultCephFSCSIDriverName = "openshift-storage.cephfs.csi.ceph.com" VeleroNamespaceNameDefault = "velero" DefaultVolSyncCopyMethod = "Snapshot" )
const ( // PV data is ready. When failing over or relocating an app to a different // cluster, app's PVC will be able to access the storage volume only after // this condition is true. VRGConditionTypeDataReady = "DataReady" // PV data is protected. This means that, the PV data from the storage // is in complete sync with its remote peer. VRGConditionTypeDataProtected = "DataProtected" // PV cluster data is ready. When failing over or relocating an app to a // different cluster, deploying the app prior to ClusterDataReady condition // could result in the PVCs binding to newly created PVs instead of binding // to their corresponding replicated PVs. App's PVC should be deployed only // after this condition is true. VRGConditionTypeClusterDataReady = "ClusterDataReady" // PV cluster data is protected. This condition indicates whether an app, // which is active in a cluster, has all its PV related cluster data // protected from a disaster by uploading it to the required S3 store(s). VRGConditionTypeClusterDataProtected = "ClusterDataProtected" // Total number of condition types in VRG as of now. Change this value // when a new condition type is added to VRG or an existing condition // type is removed from VRG status. VRGTotalConditions = 4 // VolSync related conditions. These conditions are only applicable // at individual PVCs and not generic VRG conditions. VRGConditionTypeVolSyncRepSourceSetup = "ReplicationSourceSetup" VRGConditionTypeVolSyncFinalSyncInProgress = "FinalSyncInProgress" VRGConditionTypeVolSyncRepDestinationSetup = "ReplicationDestinationSetup" VRGConditionTypeVolSyncPVsRestored = "PVsRestored" )
VRG status condition types. These condition are applicable at the VRG summary level and at the individual PVC level. The ClusterDataReady condition is only applicable at the VRG summary level and is not a condition that applies to individual PVCs.
const ( VRGConditionReasonUnused = "Unused" VRGConditionReasonInitializing = "Initializing" VRGConditionReasonReplicating = "Replicating" VRGConditionReasonReplicated = "Replicated" VRGConditionReasonReady = "Ready" VRGConditionReasonDataProtected = "DataProtected" VRGConditionReasonProgressing = "Progressing" VRGConditionReasonClusterDataRestored = "Restored" VRGConditionReasonError = "Error" VRGConditionReasonErrorUnknown = "UnknownError" VRGConditionReasonUploading = "Uploading" VRGConditionReasonUploaded = "Uploaded" VRGConditionReasonUploadError = "UploadError" VRGConditionReasonVolSyncRepSourceInited = "SourceInitialized" VRGConditionReasonVolSyncRepDestInited = "DestinationInitialized" VRGConditionReasonVolSyncPVsRestored = "Restored" VRGConditionReasonVolSyncFinalSyncInProgress = "Syncing" VRGConditionReasonVolSyncFinalSyncComplete = "Synced" VRGConditionReasonClusterDataAnnotationFailed = "AnnotationFailed" VRGConditionReasonPeerClassNotFound = "PeerClassNotFound" VRGConditionReasonStorageIDNotFound = "StorageIDNotFound" )
VRG condition reasons
const ( PvcVRFinalizerProtected = "volumereplicationgroups.ramendr.openshift.io/pvc-vr-protection" RestoreAnnotation = "volumereplicationgroups.ramendr.openshift.io/ramen-restore" RestoredByRamen = "True" // StorageClass label StorageIDLabel = "ramendr.openshift.io/storageid" // Consistency group label ConsistencyGroupLabel = "ramendr.openshift.io/consistency-group" // VolumeReplicationClass label VolumeReplicationIDLabel = "ramendr.openshift.io/replicationid" // Maintenance mode label MModesLabel = "ramendr.openshift.io/maintenancemodes" // VolumeReplicationClass schedule parameter key VRClassScheduleKey = "schedulingInterval" )
const AllDRPolicyAnnotation = "drpolicy.ramendr.openshift.io"
AllDRPolicyAnnotation is added to related resources that can be watched to reconcile all related DRPolicy resources
const (
DRClusterNameAnnotation = "drcluster.ramendr.openshift.io/drcluster-name"
)
const (
DRPolicySyncIntervalSeconds = "policy_schedule_interval_seconds"
)
const NoS3StoreAvailable = "NoS3"
FIXME
const ReasonDRClusterNotFound = "DRClusterNotFound"
ReasonDRClusterNotFound is set when the DRPolicy could not find the referenced DRCluster(s)
ReasonDRClustersUnavailable is set when the DRPolicy has none of the referenced DRCluster(s) are in a validated state
const ReasonValidationFailed = "ValidationFailed"
ReasonValidationFailed is set when the DRPolicy could not be validated or is not valid
Variables ¶
var ( WaitForAppResourceRestoreToComplete error = errorswrapper.New("Waiting for App resources to be restored...") WaitForVolSyncDestRepToComplete error = errorswrapper.New("Waiting for VolSync RD to complete...") WaitForSourceCluster error = errorswrapper.New("Waiting for primary to provide Protected PVCs...") WaitForVolSyncManifestWorkCreation error = errorswrapper.New("Waiting for VolSync ManifestWork to be created...") WaitForVolSyncRDInfoAvailibility error = errorswrapper.New("Waiting for VolSync RDInfo...") )
var ( VolumeUnprotectionEnabledForAsyncVolRep = false VolumeUnprotectionEnabledForAsyncVolSync = false )
var ControllerType ramendrv1alpha1.ControllerType
var ErrWorkflowNotFound = fmt.Errorf("backup or restore workflow not found")
var InitialWaitTimeForDRPCPlacementRule = errorswrapper.New("Waiting for DRPC Placement to produces placement decision")
Functions ¶
func AvailableS3Profiles ¶
func ConfigMapGet ¶
func ConfigMapGet( ctx context.Context, apiReader client.Reader, ) (configMap *corev1.ConfigMap, ramenConfig *ramendrv1alpha1.RamenConfig, err error)
func ConfigMapNew ¶
func ConfigMapNew( namespaceName string, name string, ramenConfig *ramendrv1alpha1.RamenConfig, ) (*corev1.ConfigMap, error)
func ConvertToPlacement ¶
func ConvertToPlacement(placementObj interface{}) *clrapiv1beta1.Placement
func ConvertToPlacementRule ¶
func ConvertToPlacementRule(placementObj interface{}) *plrv1.PlacementRule
func DRClusterPredicateFunc ¶
func DRClusterUpdateOfInterest ¶
DRClusterUpdateOfInterest checks if the new DRCluster resource as compared to the older version requires any attention, it checks for the following updates:
- If any maintenance mode is reported as activated
- If drcluster was marked for deletion
TODO: Needs some logs for easier troubleshooting
func DRPCUpdateOfInterest ¶
func DRPCUpdateOfInterest(oldDRPC, newDRPC *ramen.DRPlacementControl) bool
DRPCUpdateOfInterest returns a bool, which is true if the update to DRPC requires further processing
func DRPCsFailingOverToClusterForPolicy ¶
func DRPCsFailingOverToClusterForPolicy( k8sclient client.Client, log logr.Logger, drpolicy *rmn.DRPolicy, drcluster string, ) ([]*rmn.DRPlacementControl, error)
DRPCsFailingOverToClusterForPolicy filters DRPC resources that reference the DRPolicy and are failing over to the target cluster passed in
func DRPCsUsingDRPolicy ¶
func DRPCsUsingDRPolicy( k8sclient client.Client, log logr.Logger, drpolicy *rmn.DRPolicy, ) ([]*rmn.DRPlacementControl, error)
DRPCsUsingDRPolicy finds DRPC resources that reference the DRPolicy.
func DRPolicyPredicateFunc ¶
func DRPolicySyncIntervalMetricLabels ¶
func DRPolicySyncIntervalMetricLabels(drPolicy *rmn.DRPolicy) prometheus.Labels
dRPolicySyncInterval Metrics reports the value from schedulingInterval from DRPolicy
func DeleteDRPolicySyncIntervalMetrics ¶
func DeleteDRPolicySyncIntervalMetrics(labels prometheus.Labels) bool
func DeleteSyncDataBytesMetric ¶
func DeleteSyncDataBytesMetric(labels prometheus.Labels) bool
func DeleteSyncDurationMetric ¶
func DeleteSyncDurationMetric(labels prometheus.Labels) bool
func DeleteSyncTimeMetric ¶
func DeleteSyncTimeMetric(labels prometheus.Labels) bool
func DeleteTypedObject ¶
func DeleteTypedObject(s ObjectStorer, keyPrefix, keySuffix string, object interface{}, ) error
func DeleteWorkloadProtectionStatusMetric ¶
func DeleteWorkloadProtectionStatusMetric(labels prometheus.Labels) bool
func DownloadTypedObject ¶
func DownloadTypedObject(s ObjectStorer, keyPrefix, keySuffix string, objectPointer interface{}, ) error
func DownloadTypedObjects ¶
func DownloadTypedObjects(s ObjectStorer, keyPrefix string, objectsPointer interface{}, ) error
DownloadTypedObjects downloads all objects of the given type that have the given key prefix followed by the given object's type keyInfix.
- Example key prefix: namespace/vrgName/ Example key infix: v1.PersistentVolumeClaim/ Example new key prefix: namespace/vrgName/v1.PersistentVolumeClaim/
- Objects being downloaded should meet the decoding expectations of the DownloadObject() method.
func DownloadVRGs ¶
func DownloadVRGs(s ObjectStorer, pvKeyPrefix string) ( vrgList []ramen.VolumeReplicationGroup, err error, )
func FindProtectedPVC ¶
func FindProtectedPVC(vrg *ramen.VolumeReplicationGroup, pvcNamespaceName, pvcName string) *ramen.ProtectedPVC
func FindProtectedPvcAndIndex ¶
func FindProtectedPvcAndIndex( vrg *ramen.VolumeReplicationGroup, pvcNamespaceName, pvcName string, ) (*ramen.ProtectedPVC, int)
func GetAvailableS3Profiles ¶
func GetDRClusters ¶
func GetDRPolicy ¶
func GetRamenConfigS3StoreProfile ¶
func GetRamenConfigS3StoreProfile(ctx context.Context, apiReader client.Reader, profileName string) ( s3StoreProfile ramendrv1alpha1.S3StoreProfile, err error, )
func GetS3Secret ¶
func IsPreRelocateProgression ¶
func IsPreRelocateProgression(status rmn.ProgressionStatus) bool
func LoadControllerConfig ¶
func LoadControllerConfig(configFile string, log logr.Logger, ) (ramenConfig *ramendrv1alpha1.RamenConfig)
func LoadControllerOptions ¶
func LoadControllerOptions(options *ctrl.Options, ramenConfig *ramendrv1alpha1.RamenConfig)
func MModesFromCSV ¶
func MModesFromCSV(modes string) []ramendrv1alpha1.MMode
func ParseDoubleSlash ¶
func ParseRemoveSlashes ¶
func ParseSingleSlash ¶
func PlacementPredicateFunc ¶
func PruneAnnotations ¶
pruneAnnotations takes a map of annotations and removes the annotations where the key start with:
- pv.kubernetes.io
- replication.storage.openshift.io
- volumereplicationgroups.ramendr.openshift.io
Parameters:
annotations: the map of annotations to prune
Returns:
a new map containing only the remaining annotations
func RamenConfigS3StoreProfilePointerGet ¶
func RamenConfigS3StoreProfilePointerGet(ramenConfig *ramendrv1alpha1.RamenConfig, profileName string, ) *ramendrv1alpha1.S3StoreProfile
func RamenOperandsNamespace ¶
func RamenOperandsNamespace(config ramendrv1alpha1.RamenConfig) string
func RamenOperatorNamespace ¶
func RamenOperatorNamespace() string
func ReadRamenConfigFile ¶
func ReadRamenConfigFile(log logr.Logger) (ramenConfig *ramendrv1alpha1.RamenConfig, err error)
Read the RamenConfig file mounted in the local file system. This file is expected to be cached in the local file system. If reading of the RamenConfig file for every S3 store profile access turns out to be more expensive, we may need to enhance this logic to load it only when RamenConfig has changed.
func RecipeElementsGet ¶
func RecipeElementsGet(ctx context.Context, reader client.Reader, vrg ramen.VolumeReplicationGroup, ramenConfig ramen.RamenConfig, log logr.Logger, recipeElements *RecipeElements, ) error
func RecipeParametersExpand ¶
func RequiresDRPCReconciliation ¶
RequiresDRPCReconciliation determines if the updated DRPolicy resource, compared to the previous version, requires reconciliation of the DRPCs. Reconciliation is needed if the DRPolicy has been newly activated. This check helps avoid delays in reconciliation by ensuring timely updates when necessary.
func S3KeyPrefix ¶
func SubscriptionFromDrClusterManifestWork ¶
func SubscriptionFromDrClusterManifestWork( mwu *util.MWUtil, clusterName string, ) (*operatorsv1alpha1.Subscription, error)
func SyncDataBytesMetricLabels ¶
func SyncDataBytesMetricLabels(drPolicy *rmn.DRPolicy, drpc *rmn.DRPlacementControl) prometheus.Labels
lastSyncDataBytes Metric reports value from lastGroupSyncBytes taken from DRPC status
func SyncDurationMetricLabels ¶
func SyncDurationMetricLabels(drPolicy *rmn.DRPolicy, drpc *rmn.DRPlacementControl) prometheus.Labels
lastSyncDuration Metrics reports value from lastGroupSyncDuration from DRPC status
func SyncTimeMetricLabels ¶
func SyncTimeMetricLabels(drPolicy *rmn.DRPolicy, drpc *rmn.DRPlacementControl) prometheus.Labels
lastSyncTime metrics reports value from lastGrpupSyncTime taken from DRPC status
func TypedObjectKey ¶
func UploadPV ¶
func UploadPV(s ObjectStorer, pvKeyPrefix, pvKeySuffix string, pv corev1.PersistentVolume, ) error
UploadPV uploads the given PV to the bucket with a key of "<pvKeyPrefix><v1.PersistentVolume/><pvKeySuffix>". - pvKeyPrefix should have any required delimiters like '/' - OK to call UploadPV() concurrently from multiple goroutines safely.
func UploadPVC ¶
func UploadPVC(s ObjectStorer, pvcKeyPrefix, pvcKeySuffix string, pvc corev1.PersistentVolumeClaim, ) error
UploadPVC uploads the given PVC to the bucket with a key of "<pvcKeyPrefix><v1.PersistentVolumeClaim/><pvcKeySuffix>". - pvcKeyPrefix should have any required delimiters like '/' - OK to call UploadPVC() concurrently from multiple goroutines safely.
func VrgObjectProtect ¶
func VrgObjectProtect(objectStorer ObjectStorer, vrg ramen.VolumeReplicationGroup) error
func VrgObjectUnprotect ¶
func VrgObjectUnprotect(objectStorer ObjectStorer, vrg ramen.VolumeReplicationGroup) error
func VrgTidyForList ¶
func VrgTidyForList(vrg *ramendrv1alpha1.VolumeReplicationGroup)
func WorkloadProtectionStatusLabels ¶
func WorkloadProtectionStatusLabels(drpc *rmn.DRPlacementControl) prometheus.Labels
workloadProtectionStatus Metric reports information regarding workload protection condition from DRPC
Types ¶
type DRClusterConfigReconciler ¶
type DRClusterConfigReconciler struct { client.Client Scheme *runtime.Scheme Log logr.Logger RateLimiter *workqueue.TypedRateLimiter[reconcile.Request] }
DRClusterConfigReconciler reconciles a DRClusterConfig object
func (*DRClusterConfigReconciler) CreateClassClaims ¶
func (r *DRClusterConfigReconciler) CreateClassClaims(ctx context.Context, log logr.Logger) ([]string, error)
CreateClassClaims creates cluster claims for various storage related classes of interest
func (*DRClusterConfigReconciler) GetDRClusterConfig ¶
func (r *DRClusterConfigReconciler) GetDRClusterConfig(ctx context.Context) (*ramen.DRClusterConfig, error)
func (*DRClusterConfigReconciler) SetupWithManager ¶
func (r *DRClusterConfigReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type DRClusterReconciler ¶
type DRClusterReconciler struct { client.Client APIReader client.Reader Log logr.Logger Scheme *runtime.Scheme MCVGetter util.ManagedClusterViewGetter ObjectStoreGetter ObjectStoreGetter RateLimiter *workqueue.TypedRateLimiter[reconcile.Request] }
DRClusterReconciler reconciles a DRCluster object
func (*DRClusterReconciler) SetupWithManager ¶
func (r *DRClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type DRPCAndPolicy ¶
type DRPCAndPolicy struct {
// contains filtered or unexported fields
}
func DRPCsFailingOverToCluster ¶
func DRPCsFailingOverToCluster(k8sclient client.Client, log logr.Logger, drcluster string) ([]DRPCAndPolicy, error)
DRPCsFailingOverToCluster lists DRPC resources that are failing over to the passed in drcluster
func DRPCsUsingDRCluster ¶
func DRPCsUsingDRCluster(k8sclient client.Client, log logr.Logger, drcluster *rmn.DRCluster) ([]DRPCAndPolicy, error)
DRPCsUsingDRCluster finds DRPC resources using the DRcluster.
type DRPCInstance ¶
type DRPCInstance struct {
// contains filtered or unexported fields
}
func (*DRPCInstance) EnsureCleanup ¶
func (d *DRPCInstance) EnsureCleanup(clusterToSkip string) error
func (*DRPCInstance) EnsureSecondaryReplicationSetup ¶
func (d *DRPCInstance) EnsureSecondaryReplicationSetup(srcCluster string) error
func (*DRPCInstance) EnsureVolSyncReplicationSetup ¶
func (d *DRPCInstance) EnsureVolSyncReplicationSetup(srcCluster string) error
func (*DRPCInstance) IsVolSyncReplicationRequired ¶
func (d *DRPCInstance) IsVolSyncReplicationRequired(homeCluster string) (bool, error)
func (*DRPCInstance) ResetVolSyncRDOnPrimary ¶
func (d *DRPCInstance) ResetVolSyncRDOnPrimary(clusterName string) error
func (*DRPCInstance) RunFailover ¶
func (d *DRPCInstance) RunFailover() (bool, error)
RunFailover: 0. Check if failoverCluster is a valid target as Secondary (or already is a Primary) 1. If already failed over or in the process (VRG on failoverCluster is Primary), ensure failover is complete and then ensure cleanup 2. Else, if failover is initiated (VRG ManifestWork is create as Primary), then try again till VRG manifests itself on the failover cluster 3. Else, initiate failover to the desired failoverCluster (switchToFailoverCluster)
func (*DRPCInstance) RunInitialDeployment ¶
func (d *DRPCInstance) RunInitialDeployment() (bool, error)
func (*DRPCInstance) RunRelocate ¶
func (d *DRPCInstance) RunRelocate() (bool, error)
runRelocate checks if pre-conditions for relocation are met, and if so performs the relocation Pre-requisites for relocation are checked as follows:
- The exists at least one VRG across clusters (there is no state where we do not have a VRG as primary or secondary once initial deployment is complete)
- Ensures that there is only one primary, before further state transitions
- If there are multiple primaries, wait for one of the primaries to transition to a secondary. This can happen if MCV reports older VRG state as MW is being applied to the cluster.
- Check if peers are ready
- If there are secondaries in flight, ensure they report secondary as the observed state before moving forward
- preferredCluster should not report as Secondary, as it will never transition out of delete state in the future, as there would be no primary. This can happen, if in between relocate the preferred cluster was switched
- User needs to recover by changing the preferredCluster back to the initial intent
- Check if we already relocated to the preferredCluster, and ensure cleanup actions
- Check if current primary (that is not the preferred cluster), is ready to switch over
- Relocate!
type DRPlacementControlReconciler ¶
type DRPlacementControlReconciler struct { client.Client APIReader client.Reader Log logr.Logger MCVGetter rmnutil.ManagedClusterViewGetter Scheme *runtime.Scheme Callback ProgressCallback ObjStoreGetter ObjectStoreGetter RateLimiter *workqueue.TypedRateLimiter[reconcile.Request] // contains filtered or unexported fields }
DRPlacementControlReconciler reconciles a DRPlacementControl object
func (*DRPlacementControlReconciler) FilterDRCluster ¶
func (r *DRPlacementControlReconciler) FilterDRCluster(drcluster *rmn.DRCluster) []ctrl.Request
FilterDRCluster filters for DRPC resources that should be reconciled due to a DRCluster watch event
func (*DRPlacementControlReconciler) FilterDRPCsForDRPolicyUpdate ¶
func (r *DRPlacementControlReconciler) FilterDRPCsForDRPolicyUpdate(drpolicy *rmn.DRPolicy) []ctrl.Request
FilterDRPCsForDRPolicyUpdate filters and returns the DRPC resources that need reconciliation in response to a DRPolicy update event. This ensures that only relevant DRPCs are processed based on the changes in the associated DRPolicy.
func (*DRPlacementControlReconciler) Reconcile ¶
func (r *DRPlacementControlReconciler) 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 DRPlacementControl 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.7.0/pkg/reconcile
func (*DRPlacementControlReconciler) SetupWithManager ¶
func (r *DRPlacementControlReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type DRPolicyReconciler ¶
type DRPolicyReconciler struct { client.Client APIReader client.Reader Log logr.Logger Scheme *runtime.Scheme MCVGetter util.ManagedClusterViewGetter ObjectStoreGetter ObjectStoreGetter RateLimiter *workqueue.TypedRateLimiter[reconcile.Request] }
DRPolicyReconciler reconciles a DRPolicy object
func (*DRPolicyReconciler) 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 DRPolicy 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 (*DRPolicyReconciler) SetupWithManager ¶
func (r *DRPolicyReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type DRPolicySyncMetrics ¶
type DRPolicySyncMetrics struct {
DRPolicySyncInterval prometheus.Gauge
}
func NewDRPolicySyncIntervalMetrics ¶
func NewDRPolicySyncIntervalMetrics(labels prometheus.Labels) DRPolicySyncMetrics
type ObjectStoreGetter ¶
type ObjectStoreGetter interface { // ObjectStore returns an object that satisfies ObjectStorer interface ObjectStore(ctx context.Context, r client.Reader, s3Profile string, callerTag string, log logr.Logger, ) (ObjectStorer, ramen.S3StoreProfile, error) }
ObjectStoreGetter interface is exported because test clients use this interface.
func S3ObjectStoreGetter ¶
func S3ObjectStoreGetter() ObjectStoreGetter
S3ObjectStoreGetter returns a concrete type that implements the ObjectStoreGetter interface, allowing the concrete type to be not exported.
type ObjectStorer ¶
type ObjectStorer interface { UploadObject(key string, object interface{}) error DownloadObject(key string, objectPointer interface{}) error ListKeys(keyPrefix string) (keys []string, err error) DeleteObject(key string) error DeleteObjects(key ...string) error DeleteObjectsWithKeyPrefix(keyPrefix string) error }
type ProgressCallback ¶
ProgressCallback of function type
type ProtectedVolumeReplicationGroupListInstance ¶
type ProtectedVolumeReplicationGroupListInstance struct {
// contains filtered or unexported fields
}
func (*ProtectedVolumeReplicationGroupListInstance) GetItemsInReplicaStoreWithPrefix ¶
func (s *ProtectedVolumeReplicationGroupListInstance) GetItemsInReplicaStoreWithPrefix(s3ProfileName string, lookupPrefix string, ) ([]string, error)
func (*ProtectedVolumeReplicationGroupListInstance) ParseResultListFromReplicaStore ¶
type ProtectedVolumeReplicationGroupListReconciler ¶
type ProtectedVolumeReplicationGroupListReconciler struct { client.Client APIReader client.Reader ObjStoreGetter ObjectStoreGetter Scheme *runtime.Scheme RateLimiter *workqueue.TypedRateLimiter[reconcile.Request] }
ProtectedVolumeReplicationGroupListReconciler reconciles a ProtectedVolumeReplicationGroupList object
func (*ProtectedVolumeReplicationGroupListReconciler) Reconcile ¶
func (r *ProtectedVolumeReplicationGroupListReconciler) 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 ProtectedVolumeReplicationGroupList 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 (*ProtectedVolumeReplicationGroupListReconciler) SetupWithManager ¶
func (r *ProtectedVolumeReplicationGroupListReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type PvcSelector ¶
type PvcSelector struct { LabelSelector metav1.LabelSelector NamespaceNames []string }
func GetPVCSelector ¶
func GetPVCSelector(ctx context.Context, reader client.Reader, vrg ramen.VolumeReplicationGroup, ramenConfig ramen.RamenConfig, log logr.Logger, ) (PvcSelector, error)
type RecipeElements ¶
type RecipeElements struct { PvcSelector PvcSelector CaptureWorkflow []kubeobjects.CaptureSpec RecoverWorkflow []kubeobjects.RecoverSpec }
type ReplicationGroupDestinationReconciler ¶
ReplicationGroupDestinationReconciler reconciles a ReplicationGroupDestination object
func (*ReplicationGroupDestinationReconciler) SetupWithManager ¶
func (r *ReplicationGroupDestinationReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ReplicationGroupSourceReconciler ¶
type ReplicationGroupSourceReconciler struct { client.Client APIReader client.Reader Scheme *runtime.Scheme // contains filtered or unexported fields }
ReplicationGroupSourceReconciler reconciles a ReplicationGroupSource object
func (*ReplicationGroupSourceReconciler) Reconcile ¶
func (r *ReplicationGroupSourceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
nolint: funlen
func (*ReplicationGroupSourceReconciler) SetupWithManager ¶
func (r *ReplicationGroupSourceReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type SyncDataBytesMetrics ¶
type SyncDataBytesMetrics struct {
LastSyncDataBytes prometheus.Gauge
}
func NewSyncDataBytesMetric ¶
func NewSyncDataBytesMetric(labels prometheus.Labels) SyncDataBytesMetrics
type SyncDurationMetrics ¶
type SyncDurationMetrics struct {
LastSyncDuration prometheus.Gauge
}
func NewSyncDurationMetric ¶
func NewSyncDurationMetric(labels prometheus.Labels) SyncDurationMetrics
type SyncMetrics ¶
type SyncMetrics struct { SyncTimeMetrics SyncDurationMetrics SyncDataBytesMetrics }
type SyncTimeMetrics ¶
type SyncTimeMetrics struct {
LastSyncTime prometheus.Gauge
}
func NewSyncTimeMetric ¶
func NewSyncTimeMetric(labels prometheus.Labels) SyncTimeMetrics
type VRGInstance ¶
type VRGInstance struct {
// contains filtered or unexported fields
}
func (*VRGInstance) UploadPVAndPVCtoS3 ¶
func (v *VRGInstance) UploadPVAndPVCtoS3(s3ProfileName string, objectStore ObjectStorer, pv *corev1.PersistentVolume, pvc *corev1.PersistentVolumeClaim, ) error
func (*VRGInstance) UploadPVandPVCtoS3Store ¶
func (v *VRGInstance) UploadPVandPVCtoS3Store(s3ProfileName string, pvc *corev1.PersistentVolumeClaim) error
func (*VRGInstance) UploadPVandPVCtoS3Stores ¶
func (v *VRGInstance) UploadPVandPVCtoS3Stores(pvc *corev1.PersistentVolumeClaim, log logr.Logger, ) ([]string, error)
type VolumeReplicationGroupReconciler ¶
type VolumeReplicationGroupReconciler struct { client.Client APIReader client.Reader Log logr.Logger ObjStoreGetter ObjectStoreGetter Scheme *runtime.Scheme RateLimiter *workqueue.TypedRateLimiter[reconcile.Request] // contains filtered or unexported fields }
VolumeReplicationGroupReconciler reconciles a VolumeReplicationGroup object
func (*VolumeReplicationGroupReconciler) Reconcile ¶
func (r *VolumeReplicationGroupReconciler) 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 VolumeReplicationGroup 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.7.0/pkg/reconcile nolint: funlen
func (*VolumeReplicationGroupReconciler) SetupWithManager ¶
func (r *VolumeReplicationGroupReconciler) SetupWithManager( mgr ctrl.Manager, ramenConfig *ramendrv1alpha1.RamenConfig, ) error
SetupWithManager sets up the controller with the Manager.
type WorkloadProtectionMetrics ¶
type WorkloadProtectionMetrics struct {
WorkloadProtectionStatus prometheus.Gauge
}
func NewWorkloadProtectionStatusMetric ¶
func NewWorkloadProtectionStatusMetric(labels prometheus.Labels) WorkloadProtectionMetrics
Source Files ¶
- drcluster_controller.go
- drcluster_mmode.go
- drclusterconfig_controller.go
- drclusters.go
- drplacementcontrol.go
- drplacementcontrol_controller.go
- drplacementcontrol_watcher.go
- drplacementcontrolvolsync.go
- drpolicy.go
- drpolicy_controller.go
- drpolicy_peerclass.go
- drpolicy_watcher.go
- metrics.go
- protected_condition.go
- protectedvolumereplicationgrouplist_controller.go
- ramenconfig.go
- reconcile_result.go
- replicationgroupdestination_controller.go
- replicationgroupsource_controller.go
- s3_store_accessors.go
- s3utils.go
- status.go
- volumereplicationgroup_controller.go
- vrg_kubeobjects.go
- vrg_pvc_selector.go
- vrg_recipe.go
- vrg_status_pvcs.go
- vrg_volrep.go
- vrg_volsync.go
- vrg_vrgobject.go