Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend DRPolicy and VRG spec with PeerClasses #1480

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
ShyamsundarR marked this conversation as resolved.
Show resolved Hide resolved
// 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