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
External: configure sc properties for external cluster EC RBD pool #1440
External: configure sc properties for external cluster EC RBD pool #1440
Conversation
b0f71c6
to
40069ff
Compare
@leseb ^^ |
marked as draft as I need to check how to test external cluster changes. |
@@ -228,6 +228,12 @@ func newCephBlockPoolStorageClassConfiguration(initData *ocsv1.StorageCluster) S | |||
disable: managementSpec.DisableStorageClass, | |||
isClusterExternal: initData.Spec.ExternalStorage.Enable, | |||
} | |||
if dataPool != "" { |
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 are checking whether the dataPool
argument is empty or not, but where are we using it?
In the line#233, we are directly creating a value (using the function generateNameForEcCephBlockPool()
) for the dataPool
key.
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's a good point. Where is dataPool
used? With EC, the SC config looks like this:
EDIT: actually the code is a bit confusing but this is where parameters are set:
ocs-operator/controllers/storagecluster/external_resources.go
Lines 332 to 334 in d64079d
for k, v := range d.Data { | |
scc.storageClass.Parameters[k] = v | |
} |
So dataPool
and pool
will be populated according to the JSON blob content.
/cc @aruniiird |
@agarwal-mudit: GitHub didn't allow me to request PR reviews from the following users: aruniiird. Note that only red-hat-storage members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -228,6 +228,12 @@ func newCephBlockPoolStorageClassConfiguration(initData *ocsv1.StorageCluster) S | |||
disable: managementSpec.DisableStorageClass, | |||
isClusterExternal: initData.Spec.ExternalStorage.Enable, | |||
} | |||
if dataPool != "" { |
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's a good point. Where is dataPool
used? With EC, the SC config looks like this:
EDIT: actually the code is a bit confusing but this is where parameters are set:
ocs-operator/controllers/storagecluster/external_resources.go
Lines 332 to 334 in d64079d
for k, v := range d.Data { | |
scc.storageClass.Parameters[k] = v | |
} |
So dataPool
and pool
will be populated according to the JSON blob content.
40069ff
to
d8409a3
Compare
d8409a3
to
99357d3
Compare
if data["dataPool"] != "" { | ||
sc.storageClass.Parameters["pool"] = generateNameForErasureCodedCephBlockPool(initData) | ||
sc.storageClass.Parameters["dataPool"] = generateNameForCephBlockPool(initData) | ||
} | ||
return sc |
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.
I wonder if this block is actually needed since the cluster is external and we don't support EC in converged AFAIK.
@aruniiird to confirm?
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.
You are right, we don't require dataPool
value to be set here.
IMO, we don't even have to touch the function newCephBlockPoolStorageClassConfiguration()
at all because, as you mentioned in the above comment, that for
loop will provide appropriate values for both pool
and dataPool
parameters.
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, basically we don't need any change just adding unit test to verify working.
99357d3
to
976eebf
Compare
Adding unit test to verify erasure coded pool in case of RBD in external cluster. Links: 1) storageClass https://github.com/rook/rook/blob/master/deploy/examples/csi/rbd/storageclass-ec.yaml#L45 2) Json Blob in case of EC RBD pool rook/rook#9276 (comment) Signed-off-by: subhamkrai <srai@redhat.com>
976eebf
to
951032a
Compare
@subhamkrai: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
actualSC.storageClass.Parameters[k] = v | ||
} | ||
assert.NotEmpty(t, actualSC.storageClass.Parameters["clusterID"]) | ||
assert.Equal(t, extR.Data["dataPool"], actualSC.storageClass.Parameters["dataPool"]) |
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.
Where do you test that the dataPool
name is ec-data-pool
?
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.
"dataPool": "ec-data-pool",
this what I'm passing as JSON blob
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.
Yes and it should be in the SC parameters, so the unit test should validate this.
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.
maybe I'm missing something but I'm passing "dataPool": "ec-data-pool"
in the JSON blob and checking it with storage class parameters actualSC.storageClass.Parameters["dataPool"])
if provided is equal to expected.
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
@aruniiird: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: agarwal-mudit, aruniiird, leseb, subhamkrai The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Adding extra field in storageClass "dataPool" when pool is
erasure coded pool in case of RBD.
Links:
Signed-off-by: subhamkrai srai@redhat.com