Skip to content

Commit

Permalink
extend DRPolicy and VRG spec with PeerClasses
Browse files Browse the repository at this point in the history
Signed-off-by: rakeshgm <[email protected]>
  • Loading branch information
rakeshgm authored and ShyamsundarR committed Oct 17, 2024
1 parent 3929be6 commit 67f473d
Show file tree
Hide file tree
Showing 6 changed files with 308 additions and 5 deletions.
43 changes: 43 additions & 0 deletions api/v1alpha1/drpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,49 @@ type DRPolicySpec struct {
// DRPolicyStatus defines the observed state of DRPolicy
type DRPolicyStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty"`

// DRPolicyStatus.Async contains the status of observed
// async replication details between the clusters in the policy
//+optional
Async Async `json:"async,omitempty"`

// DRPolicyStatus.Sync contains the status of observed
// sync replication details between the clusters in the policy
//+optional
Sync Sync `json:"sync,omitempty"`
}

// for RDR
type Async struct {
// PeerClasses is a list of common StorageClasses across the clusters in a policy
// that have related async relationships. (one per pair of peers in the policy)
//+optional
PeerClasses []PeerClass `json:"peerClasses,omitempty"`
}

// for MetroDR
type Sync struct {
// PeerClasses is a list of common StorageClasses across the clusters in a policy
// that have related sync relationships. (one per pair of peers in the policy)
//+optional
PeerClasses []PeerClass `json:"peerClasses,omitempty"`
}

type PeerClass struct {
// ReplicationID is the common value for the label "ramendr.openshift.io/replicationID" on the corresponding
// VolumeReplicationClass or VolumeGroupReplicationClass on each peer for the matched StorageClassName.
//+optional
ReplicationID string `json:"replicationID,omitempty"`

// StorageID is the collection of values for the label "ramendr.openshift.io/storageID" on the corresponding
// StorageClassName across the peers. It is singleton if the storage instance is shared across the peers,
// and distict if storage instances are different.
//+optional
StorageID []string `json:"storageID,omitempty"`

// StorageClassName is the name of a StorageClass that is available across the peers
//+optional
StorageClassName string `json:"storageClassName,omitempty"`
}

const (
Expand Down
16 changes: 14 additions & 2 deletions api/v1alpha1/volumereplicationgroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,22 @@ type VRGAsyncSpec struct {
// +kubebuilder:validation:Required
// +kubebuilder:validation:Pattern=`^\d+[mhd]$`
SchedulingInterval string `json:"schedulingInterval"`

// PeerClasses is a list of common StorageClasses across the clusters in a policy that have related
// sync relationships. This is ONLY modified post creation, if the workload that is protected
// creates a PVC using a newer StorageClass that is determined to be common across the peers.
//+optional
PeerClasses []PeerClass `json:"peerClasses,omitempty"`
}

// VRGSyncSpec has the parameters associated with MetroDR
type VRGSyncSpec struct{}
// VRGSyncSpec has the parameters associated with VE
type VRGSyncSpec struct {
// PeerClasses is a list of common StorageClasses across the clusters in a policy that have related
// async relationships. This is ONLY modified post creation, if the workload that is protected
// creates a PVC using a newer StorageClass that is determined to be common across the peers.
//+optional
PeerClasses []PeerClass `json:"peerClasses,omitempty"`
}

// VolSyncReplicationDestinationSpec defines the configuration for the VolSync
// protected PVC to be used by the destination cluster (Secondary)
Expand Down
82 changes: 81 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions config/crd/bases/ramendr.openshift.io_drpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,37 @@ spec:
status:
description: DRPolicyStatus defines the observed state of DRPolicy
properties:
async:
description: |-
DRPolicyStatus.Async contains the status of observed
async replication details between the clusters in the policy
properties:
peerClasses:
description: |-
PeerClasses is a list of common StorageClasses across the clusters in a policy
that have related async relationships. (one per pair of peers in the policy)
items:
properties:
replicationID:
description: |-
ReplicationID is the common value for the label "ramendr.openshift.io/replicationID" on the corresponding
VolumeReplicationClass or VolumeGroupReplicationClass on each peer for the matched StorageClassName.
type: string
storageClassName:
description: StorageClassName is the name of a StorageClass
that is available across the peers
type: string
storageID:
description: |-
StorageID is the collection of values for the label "ramendr.openshift.io/storageID" on the corresponding
StorageClassName across the peers. It is singleton if the storage instance is shared across the peers,
and distict if storage instances are different.
items:
type: string
type: array
type: object
type: array
type: object
conditions:
items:
description: "Condition contains details for one aspect of the current
Expand Down Expand Up @@ -291,6 +322,37 @@ spec:
- type
type: object
type: array
sync:
description: |-
DRPolicyStatus.Sync contains the status of observed
sync replication details between the clusters in the policy
properties:
peerClasses:
description: |-
PeerClasses is a list of common StorageClasses across the clusters in a policy
that have related sync relationships. (one per pair of peers in the policy)
items:
properties:
replicationID:
description: |-
ReplicationID is the common value for the label "ramendr.openshift.io/replicationID" on the corresponding
VolumeReplicationClass or VolumeGroupReplicationClass on each peer for the matched StorageClassName.
type: string
storageClassName:
description: StorageClassName is the name of a StorageClass
that is available across the peers
type: string
storageID:
description: |-
StorageID is the collection of values for the label "ramendr.openshift.io/storageID" on the corresponding
StorageClassName across the peers. It is singleton if the storage instance is shared across the peers,
and distict if storage instances are different.
items:
type: string
type: array
type: object
type: array
type: object
type: object
type: object
served: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,32 @@ spec:
description: VRGAsyncSpec has the parameters associated
with RegionalDR
properties:
peerClasses:
description: |-
PeerClasses is a list of common StorageClasses across the clusters in a policy that have related
sync relationships. This is ONLY modified post creation, if the workload that is protected
creates a PVC using a newer StorageClass that is determined to be common across the peers.
items:
properties:
replicationID:
description: |-
ReplicationID is the common value for the label "ramendr.openshift.io/replicationID" on the corresponding
VolumeReplicationClass or VolumeGroupReplicationClass on each peer for the matched StorageClassName.
type: string
storageClassName:
description: StorageClassName is the name of a
StorageClass that is available across the peers
type: string
storageID:
description: |-
StorageID is the collection of values for the label "ramendr.openshift.io/storageID" on the corresponding
StorageClassName across the peers. It is singleton if the storage instance is shared across the peers,
and distict if storage instances are different.
items:
type: string
type: array
type: object
type: array
replicationClassSelector:
description: |-
Label selector to identify the VolumeReplicationClass resources
Expand Down Expand Up @@ -422,7 +448,34 @@ spec:
type: array
sync:
description: VRGSyncSpec has the parameters associated with
MetroDR
VE
properties:
peerClasses:
description: |-
PeerClasses is a list of common StorageClasses across the clusters in a policy that have related
async relationships. This is ONLY modified post creation, if the workload that is protected
creates a PVC using a newer StorageClass that is determined to be common across the peers.
items:
properties:
replicationID:
description: |-
ReplicationID is the common value for the label "ramendr.openshift.io/replicationID" on the corresponding
VolumeReplicationClass or VolumeGroupReplicationClass on each peer for the matched StorageClassName.
type: string
storageClassName:
description: StorageClassName is the name of a
StorageClass that is available across the peers
type: string
storageID:
description: |-
StorageID is the collection of values for the label "ramendr.openshift.io/storageID" on the corresponding
StorageClassName across the peers. It is singleton if the storage instance is shared across the peers,
and distict if storage instances are different.
items:
type: string
type: array
type: object
type: array
type: object
volSync:
description: volsync defines the configuration when using
Expand Down
Loading

0 comments on commit 67f473d

Please sign in to comment.