-
Notifications
You must be signed in to change notification settings - Fork 57
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
List protected consistency groups in VRG and DRPC #1647
base: main
Are you sure you want to change the base?
Conversation
7d1bdc7
to
687aab7
Compare
687aab7
to
25a7e83
Compare
@@ -167,6 +167,16 @@ type PlacementDecision struct { | |||
ClusterNamespace string `json:"clusterNamespace,omitempty"` | |||
} | |||
|
|||
// ProtectedPVCsList defines a group of ProtectedPVCs | |||
type ProtectedPVCsList struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that you are using List
in the name, then drop the s
, It becomes type ProtectedPVCList struct
type ProtectedPVCsList struct { | ||
// Name of the VolRep/PVC resource | ||
//+optional | ||
Name string `json:"name,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is confusing. Where are you going to get this name from? I think you mean some name for either VolRep or VolSync, but not both.
//+optional | ||
Name string `json:"name,omitempty"` | ||
|
||
// All the protected pvcs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the protected PVCs for a VolRep
or VolSync
but not both right?
ProtectedPVC `json:",inline"` | ||
|
||
// List the protected pvcs names | ||
PVCs []string `json:"protectedPVCs,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this looks like:
ProtectedPVC:
Name: pvcName1
Namespace: ...
...
PVCs:
pvcName1
pvcName2
I think it is too complicated. I think what we want is something like:
type ProtectedCG struct {
Name: <any name that represents one group>
ProtectedPVCs []ProtectedPVC
}
That will translate for one ProtectedCG
to something like:
ProtectedCG:
name: CG1
protectedPVCs:
- accessModes:
- ReadWriteOnce
annotations:
...
name: busybox-cg1-pvc1
...
- accessModes:
- ReadWriteOnce
annotations:
...
name: busybox-cg1-pvc2
....
.....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BenamarMk , as I understood from Madhu, when we are speaking of consistency group, there is no info on PVC level, only CG has conditions, etc. So, I decided to show all the conditions on CG level and then to append list of protected PVC names. I attached the sample in the description of the PR,
So, to be simple - protected CG looks exactly like protected PVC, but with list of PVC names
@ELENAGER This PR only has the api changes, it would be better to see the code that adds this information to the status in the same PR. Also, I am still wondering if a consistency group is a hierarchy level or just an attribute on the protectedPVC. What are you thoughts @BenamarMk @ShyamsundarR |
@@ -185,6 +195,10 @@ type VRGResourceMeta struct { | |||
//+optional | |||
ProtectedPVCs []string `json:"protectedpvcs,omitempty"` | |||
|
|||
// List of CGs that are protected by the VRG resource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding a synthetic name
for each group, can we simplify this to something like so:
status:
resourceConditions:
resourceMeta:
generation: 1
kind: Test
name: test
namespace: test
protectedpvcs:
- mongo-1
- mongo-2
- logger
- data
pvcgroups:
- grouped:
- mongo-1
- mongo-2
- grouped:
- logger
- data
Generated using this sample change to the types file:
index b4cb8d04..7164b143 100644
--- a/api/v1alpha1/drplacementcontrol_types.go
+++ b/api/v1alpha1/drplacementcontrol_types.go
@@ -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.
@@ -184,6 +188,7 @@ type VRGResourceMeta struct {
// List of PVCs that are protected by the VRG resource
//+optional
ProtectedPVCs []string `json:"protectedpvcs,omitempty"`
+ PVCGroups []Groups `json:"pvcgroups,omitempty"`
// ResourceVersion is a value used to identify the version of the
// VRG resource object
ProtectedPVCs []ProtectedPVC `json:"protectedPVCs,omitempty"` | ||
ProtectedCGs []ProtectedCG `json:"protectedCGs,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly here we can just add a patch like so:
index 0332a027..d2362589 100644
--- a/api/v1alpha1/volumereplicationgroup_types.go
+++ b/api/v1alpha1/volumereplicationgroup_types.go
@@ -327,6 +327,7 @@ type VolumeReplicationGroupStatus struct {
// All the protected pvcs
ProtectedPVCs []ProtectedPVC `json:"protectedPVCs,omitempty"`
+ PVCGroups []Groups `json:"pvcgroups,omitempty"`
// Conditions are the list of VRG's summary conditions and their status.
Conditions []metav1.Condition `json:"conditions,omitempty"`
Let ProtectedPVCs and their details remain as is, no need to disturb them.
We also will avoid needing to synthetically generate a name per group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to Madhu, in case of groups we have no information on PVC level, only group have conditions. If so, why we need the whole ProtectedPVC list? It was my first thought, but then I decided, that ProtectedCG can "become" ProtectedPVC with list of pvc names in addition
There is (at present) no hierarchy for the groups. PVCs are protected as a group, thereby having some additional properties (like consistency across these PVCs data). The need is to reflect back to the user, which PVCs were grouped together during protection, in case it is seen as an inadequate grouping the user can take subsequent action to group them as desired. |
When protecting standalone PVCs, we are displaying list of protected PVCs in VRG and DRPC. When working with consistency groups, we want to display the list of protected PVCs per consistency groups for better understanding, what was protected Signed-off-by: Elena Gershkovich <[email protected]>
25a7e83
to
ade0884
Compare
When protecting standalone PVCs, we are displaying flat list of protected PVCs in both VRG and DRPC. When working with consistency groups, we want to display the list of protected consistency groups each one with it's protected PVCs for better understanding the hierarchy
Sample of DRPC showing protected consistency group with list of PVCs:
Sample of VRG, showing protected consistency group with list of PVCs: