Skip to content

Commit

Permalink
Add VolumeGroupReplication support.
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Gershkovich <[email protected]>
  • Loading branch information
ELENAGER committed Dec 9, 2024
1 parent c2ec69f commit 9c5f0d5
Show file tree
Hide file tree
Showing 15 changed files with 1,485 additions and 128 deletions.
8 changes: 8 additions & 0 deletions api/v1alpha1/drplacementcontrol_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ type PlacementDecision struct {
ClusterNamespace string `json:"clusterNamespace,omitempty"`
}

type Groups struct {
Grouped []string `json:"grouped,omitempty"`
}

// VRGResourceMeta represents the VRG resource.
type VRGResourceMeta struct {
// Kind is the kind of the Kubernetes resource.
Expand All @@ -185,6 +189,10 @@ type VRGResourceMeta struct {
//+optional
ProtectedPVCs []string `json:"protectedpvcs,omitempty"`

// List of CGs that are protected by the VRG resource
//+optional
PVCGroups []Groups `json:"pvcgroups,omitempty"`

// ResourceVersion is a value used to identify the version of the
// VRG resource object
//+optional
Expand Down
3 changes: 3 additions & 0 deletions api/v1alpha1/volumereplicationgroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@ type VolumeReplicationGroupStatus struct {

// All the protected pvcs
ProtectedPVCs []ProtectedPVC `json:"protectedPVCs,omitempty"`
// List of CGs that are protected by the VRG resource
//+optional
PVCGroups []Groups `json:"pvcgroups,omitempty"`

// Conditions are the list of VRG's summary conditions and their status.
Conditions []metav1.Condition `json:"conditions,omitempty"`
Expand Down
34 changes: 34 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

10 changes: 10 additions & 0 deletions config/crd/bases/ramendr.openshift.io_drplacementcontrols.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ spec:
items:
type: string
type: array
pvcgroups:
description: List of CGs that are protected by the VRG resource
items:
properties:
grouped:
items:
type: string
type: array
type: object
type: array
resourceVersion:
description: |-
ResourceVersion is a value used to identify the version of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,16 @@ spec:
type: string
type: object
type: array
pvcgroups:
description: List of CGs that are protected by the VRG resource
items:
properties:
grouped:
items:
type: string
type: array
type: object
type: array
state:
description: State captures the latest state of the replication
operation
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/ramendr.openshift.io_volumereplicationgroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,16 @@ spec:
type: string
type: object
type: array
pvcgroups:
description: List of CGs that are protected by the VRG resource
items:
properties:
grouped:
items:
type: string
type: array
type: object
type: array
state:
description: State captures the latest state of the replication operation
type: string
Expand Down
2 changes: 2 additions & 0 deletions config/dr-cluster/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ rules:
- apiGroups:
- replication.storage.openshift.io
resources:
- volumegroupreplicationclasses
- volumereplicationclasses
verbs:
- get
Expand All @@ -170,6 +171,7 @@ rules:
- apiGroups:
- replication.storage.openshift.io
resources:
- volumegroupreplications
- volumereplications
verbs:
- create
Expand Down
2 changes: 2 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ rules:
- apiGroups:
- replication.storage.openshift.io
resources:
- volumegroupreplicationclasses
- volumereplicationclasses
verbs:
- get
Expand All @@ -294,6 +295,7 @@ rules:
- apiGroups:
- replication.storage.openshift.io
resources:
- volumegroupreplications
- volumereplications
verbs:
- create
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
name: volumegroupreplicationclasses.replication.storage.openshift.io
spec:
group: replication.storage.openshift.io
names:
kind: VolumeGroupReplicationClass
listKind: VolumeGroupReplicationClassList
plural: volumegroupreplicationclasses
singular: volumegroupreplicationclass
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: VolumeGroupReplicationClass is the Schema for the volumegroupreplicationclasses
API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: |-
VolumeGroupReplicationClassSpec specifies parameters that an underlying storage system uses
when creating a volumegroup replica. A specific VolumeGroupReplicationClass is used by specifying
its name in a VolumeGroupReplication object.
properties:
parameters:
additionalProperties:
type: string
description: |-
Parameters is a key-value map with storage provisioner specific configurations for
creating volume group replicas
type: object
x-kubernetes-validations:
- message: parameters are immutable
rule: self == oldSelf
provisioner:
description: Provisioner is the name of storage provisioner
type: string
x-kubernetes-validations:
- message: provisioner is immutable
rule: self == oldSelf
required:
- provisioner
type: object
x-kubernetes-validations:
- message: parameters are immutable
rule: has(self.parameters) == has(oldSelf.parameters)
status:
description: VolumeGroupReplicationClassStatus defines the observed state
of VolumeGroupReplicationClass
type: object
type: object
served: true
storage: true
subresources:
status: {}
Loading

0 comments on commit 9c5f0d5

Please sign in to comment.