Skip to content

api: add volumeGroupAttributes field to VGRContent API #782

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iPraveenParihar
Copy link
Member

@iPraveenParihar iPraveenParihar commented Mar 18, 2025

This commit introduces volumeGroupAttributes field to
VolumeGroupReplicationContent API.

The field is intended to store key-value pairs derived
from the VolumeGroupContext returned by CSI drivers in the
CreateVolumeGroupResponse.

@iPraveenParihar iPraveenParihar requested a review from Madhu-1 March 18, 2025 08:15
@mergify mergify bot added the api Change to the API, requires extra care label Mar 18, 2025
@iPraveenParihar iPraveenParihar force-pushed the api/add-volumegroupattributes branch from 18c9334 to 203a117 Compare March 18, 2025 08:29
@iPraveenParihar iPraveenParihar marked this pull request as ready for review March 18, 2025 12:24
Copy link
Collaborator

@nixpanic nixpanic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What kind of attributes are these, and where do they come from? Would be good to see something about them in the documentation and/or protocol specification.

@iPraveenParihar
Copy link
Member Author

iPraveenParihar commented Mar 18, 2025

What kind of attributes are these, and where do they come from? Would be good to see something about them in the documentation and/or protocol specification.

fyi: ceph/ceph-csi#5220
These attributes will be added from VolumeGroupReplicationClass.
Sure, will try to add about them in appropriate docs.

@nixpanic
Copy link
Collaborator

fyi: ceph/ceph-csi#5220

Thanks for the reference. That is just one implementation of a csi-driver with csi-addons support. Please included a description/design for the need of attributes, and what attributes are somewhere in this csi-driver-independent project.

@iPraveenParihar iPraveenParihar marked this pull request as draft March 18, 2025 17:03
@iPraveenParihar
Copy link
Member Author

fyi: ceph/ceph-csi#5220

Thanks for the reference. That is just one implementation of a csi-driver with csi-addons support. Please included a description/design for the need of attributes, and what attributes are somewhere in this csi-driver-independent project.

Instead of specifying what parameters to add or adding all, I'd like to do for volume‑groups what CSI already does for individual volumes, when we create a PV, the external provisioner takes the key‑value pairs returned by the CSI driver in CreateVolumeResponse.Volume.VolumeContext and stuffs them into pv.spec.csi.volumeAttributes.

Can we do the same thing for a VolumeGroup? IOW, have the CSI drivers return its own attributes in CreateVolumeGroupResponse.VolumeGroup.VolumeGroupContext, and then let the VolumeGroupReplicationContent controller copy those entries into VolumeGroupReplicationContent.spec.volumeGroupAttributes?

WDYT? @Madhu-1 @Nikhil-Ladha

@Madhu-1
Copy link
Member

Madhu-1 commented Apr 22, 2025

fyi: ceph/ceph-csi#5220

Thanks for the reference. That is just one implementation of a csi-driver with csi-addons support. Please included a description/design for the need of attributes, and what attributes are somewhere in this csi-driver-independent project.

Instead of specifying what parameters to add or adding all, I'd like to do for volume‑groups what CSI already does for individual volumes, when we create a PV, the external provisioner takes the key‑value pairs returned by the CSI driver in CreateVolumeResponse.Volume.VolumeContext and stuffs them into pv.spec.csi.volumeAttributes.

Can we do the same thing for a VolumeGroup? IOW, have the CSI drivers return its own attributes in CreateVolumeGroupResponse.VolumeGroup.VolumeGroupContext, and then let the VolumeGroupReplicationContent controller copy those entries into VolumeGroupReplicationContent.spec.volumeGroupAttributes?

WDYT? @Madhu-1 @Nikhil-Ladha

Yes thats what we need to do, its the context parameters returned by csi driver during create operation

@nixpanic
Copy link
Collaborator

Instead of specifying what parameters to add or adding all, I'd like to do for volume‑groups what CSI already does for individual volumes, when we create a PV, the external provisioner takes the key‑value pairs returned by the CSI driver in CreateVolumeResponse.Volume.VolumeContext and stuffs them into pv.spec.csi.volumeAttributes.

Sure. that is a reasonable explanation. As CreateVolumeGroupResponse.VolumeGroup.VolumeGroupContext already exists, it might even have been an oversight and this could be marked as a bug.

@Nikhil-Ladha
Copy link
Contributor

Nikhil-Ladha commented Apr 22, 2025

Instead of specifying what parameters to add or adding all, I'd like to do for volume‑groups what CSI already does for individual volumes, when we create a PV, the external provisioner takes the key‑value pairs returned by the CSI driver in CreateVolumeResponse.Volume.VolumeContext and stuffs them into pv.spec.csi.volumeAttributes.

Can we do the same thing for a VolumeGroup? IOW, have the CSI drivers return its own attributes in CreateVolumeGroupResponse.VolumeGroup.VolumeGroupContext, and then let the VolumeGroupReplicationContent controller copy those entries into VolumeGroupReplicationContent.spec.volumeGroupAttributes?

WDYT? @Madhu-1 @Nikhil-Ladha

That is a better approach.
But, in that case we would still have to depend on VolumeGroupReplicationClass in the omap generator to fetch the secrets, as we won't be storing them in VGRContent. The secrets won't be returned in those attributes, right?
We have spec.csi.controllerExpandSecretRef in PV that contains the secrets, so are we planning to have something like that in VGRContent as well?

@Madhu-1
Copy link
Member

Madhu-1 commented Apr 22, 2025

But, in that case we would still have to depend on VolumeGroupReplicationClass in the omap generator to fetch the secrets, as we won't be storing them in VGRContent. The secrets won't be returned in those attributes, right?
We have spec.csi.controllerExpandSecretRef in PV that contains the secrets, so are we planning to have something like that in VGRContent as well?

@Nikhil-Ladha IMO we dont need to introduce a new fields for it. we could store it as annotation in the VGR not at the VGRC. we pass the parameters from the VGRC always for all the Group RPC calls. we can revisit the secrets later

@Nikhil-Ladha
Copy link
Contributor

But, in that case we would still have to depend on VolumeGroupReplicationClass in the omap generator to fetch the secrets, as we won't be storing them in VGRContent. The secrets won't be returned in those attributes, right?
We have spec.csi.controllerExpandSecretRef in PV that contains the secrets, so are we planning to have something like that in VGRContent as well?

@Nikhil-Ladha IMO we dont need to introduce a new fields for it. we could store it as annotation in the VGR not at the VGRC. we pass the parameters from the VGRC always for all the Group RPC calls. we can revisit the secrets later

But, isn't that was the initial purpose of the issue?
That is to avoid dependency on VGRClass for omap generation?

RPC calls are fine, we filter the secret params and pass it to the RPC.
But, even after the proposed change we would continue to use VGRClass in omap generator. So, I am not sure how are we planning to address that?

@Madhu-1
Copy link
Member

Madhu-1 commented Apr 22, 2025

RPC calls are fine, we filter the secret params and pass it to the RPC.
But, even after the proposed change we would continue to use VGRClass in omap generator. So, I am not sure how are we planning to address that?

Yes we need to address it in different PR's. as i mentioned earlier we can use annotation for it.

@Nikhil-Ladha
Copy link
Contributor

RPC calls are fine, we filter the secret params and pass it to the RPC.
But, even after the proposed change we would continue to use VGRClass in omap generator. So, I am not sure how are we planning to address that?

Yes we need to address it in different PR's. as i mentioned earlier we can use annotation for it.

Ack.
Yeah, in case of annotation it would be VGRContent then instead of VGR, as that is referred for omap generation.

@iPraveenParihar iPraveenParihar force-pushed the api/add-volumegroupattributes branch from 203a117 to 02bb159 Compare April 23, 2025 10:01
@iPraveenParihar iPraveenParihar marked this pull request as ready for review April 23, 2025 10:01
@mergify mergify bot requested a review from Nikhil-Ladha April 23, 2025 10:02
@iPraveenParihar
Copy link
Member Author

Sure. that is a reasonable explanation. As CreateVolumeGroupResponse.VolumeGroup.VolumeGroupContext already exists, it might even have been an oversight and this could be marked as a bug.

we should be good with changes in this PR?

This commit introduces `volumeGroupAttributes` field to
`VolumeGroupReplicationContent` API.

The field is intended to store key-value pairs derived
from the VolumeGroupContext returned by CSI drivers in the
CreateVolumeGroupResponse.

Signed-off-by: Praveen M <[email protected]>
@iPraveenParihar iPraveenParihar force-pushed the api/add-volumegroupattributes branch from 02bb159 to f6b23bb Compare April 23, 2025 10:12
@Madhu-1
Copy link
Member

Madhu-1 commented Apr 23, 2025

RPC calls are fine, we filter the secret params and pass it to the RPC.
But, even after the proposed change we would continue to use VGRClass in omap generator. So, I am not sure how are we planning to address that?

Yes we need to address it in different PR's. as i mentioned earlier we can use annotation for it.

Ack. Yeah, in case of annotation it would be VGRContent then instead of VGR, as that is referred for omap generation.

i would store the secrets on the VGR not on VGRC (like we store the provisioner secret on the PVC) secrets are optional and not a mandatory fields .

@Nikhil-Ladha
Copy link
Contributor

i would store the secrets on the VGR not on VGRC (like we store the provisioner secret on the PVC) secrets are optional and not a mandatory fields .

In that case, we should update the issue description to reflect the same for awareness.

@iPraveenParihar
Copy link
Member Author

@Madhu-1 @Nikhil-Ladha PTAL
If there is nothing more to be done here, we can merge it?

Copy link
Contributor

@Nikhil-Ladha Nikhil-Ladha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Change to the API, requires extra care
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants