-
Notifications
You must be signed in to change notification settings - Fork 32
Setting csi controller plugin hostNetwork for data replication seperation #498
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
Setting csi controller plugin hostNetwork for data replication seperation #498
Conversation
leelavg
left a comment
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.
LGTM, let's not use "HostNet" we are using "HostNetwork" in rest of the places.
| for i := range storageClients.Items { | ||
| if storageClients.Items[i].Status.RbdDriverRequirements != nil { | ||
| enableRbdDriver = true | ||
| useHostNetForRbdCtrlPlugin = storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNet |
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.
Could there be a situation where we have two storage clients, with one using hostNetwork and the other not? What would be the expected value for useHostNetForRbdCtrlPlugin value in that case?
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.
Updated
| apiVersion: v1 | ||
| data: | ||
| generateRbdOMapInfo: "true" | ||
| topologyFailureDomainLabels: "" |
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.
why is this removed?
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.
This is automatically getting removed while doing make bundle
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.
@leelavg dont we have CI job to catch this one?
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.
looks like without removing this verify_generated_changes is failing
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.
that line was added in https://github.com/red-hat-storage/ocs-client-operator/pull/495/files
and should also be added in https://github.com/red-hat-storage/ocs-client-operator/blob/main/config/manager/kustomization.yaml#L8
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.
Shall I add the chage mentioned in the above comment in this PR or have a new one?
make bundle removes this line in main branch as well
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.
we need to make the CI happy, please add it as part of this PR
| for i := range storageClients.Items { | ||
| if storageClients.Items[i].Status.RbdDriverRequirements != nil { | ||
| enableRbdDriver = true | ||
| useHostNetForRbdCtrlPlugin = storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNet |
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.
if storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNet{
useHostNetForRbdCtrlPlugin=true
}
we should use host networking if one client is having this value set to true
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.
Updated
bb5fb24 to
86f1495
Compare
| enableCephFsDriver := c.shouldEnableDriver(enableCephFsDriverKey) | ||
| enableNfsDriver := c.shouldEnableDriver(enableNfsDriverKey) | ||
|
|
||
| var useHostNetForRbdCtrlPlugin, useHostNetForCephFsCtrlPlugin, useHostNetForNfsCtrlPlugin *bool |
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.
why do we need this as point to bool? lets keep it bool only
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.
done
Madhu-1
left a comment
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.
/lgtm
|
/hold |
|
adding hold label to have a chance for others to review. @leelavg @rewantsoni PTAL |
| if storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNetwork != nil && | ||
| *storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNetwork { | ||
| useHostNetForRbdCtrlPlugin = ptr.Deref(storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNetwork, false) | ||
| } |
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.
Can this be simplified to this?
| if storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNetwork != nil && | |
| *storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNetwork { | |
| useHostNetForRbdCtrlPlugin = ptr.Deref(storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNetwork, false) | |
| } | |
| if useHostNetwork:=storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNetwork; useHostNetwork != nil { | |
| useHostNetForRbdCtrlPlugin = ptr.Deref(useHostNetwork, false) | |
| } |
Or maybe something like to make sure if it is enabled for even one client it will be enabled for all clients?
| if storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNetwork != nil && | |
| *storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNetwork { | |
| useHostNetForRbdCtrlPlugin = ptr.Deref(storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNetwork, false) | |
| } | |
| if useHostNetwork:=storageClients.Items[i].Status.RbdDriverRequirements.CtrlPluginHostNetwork; useHostNetwork != nil { | |
| useHostNetForRbdCtrlPlugin = useHostNetForRbdCtrlPlugin || ptr.Deref(useHostNetwork, false) | |
| } |
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.
second option looks clean, updated the changes
fetch the provider api changes required for csi controller plugin host network Signed-off-by: Rohan Gupta <[email protected]>
added csi ctrl plugin host network setting per driver in storage client status, based on this setting operator configmap controller will enable/disable host network for csi controllers Signed-off-by: Rohan Gupta <[email protected]>
csi controller plugin host network will be configured for drivers based on the information send via provider server Signed-off-by: Rohan Gupta <[email protected]>
Signed-off-by: Rohan Gupta <[email protected]>
|
/hold |
|
Verified the changes |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Madhu-1, rewantsoni, rohan47 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/unhold |
68ce318
into
red-hat-storage:main
client-operator will receive information for enabling host network for csi controller plugins if data replicaion seperation is enabled and will configure it for the csi drivers