-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
rbd: node fencing, skip pv when pv is not backed by csi #12563
Conversation
612435b
to
4563240
Compare
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. we might need to handle static PVC also.
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, thanks !
can you explain more? @Madhu-1 |
Take a look at the doc https://github.com/ceph/ceph-csi/blob/devel/docs/static-pvc.md#create-rbd-static-pv. the RBD static PV doesn't contains some parameters like |
okay, I'll test in this pr and update here, adding |
I was testing with same example mentioned in the doc and noticed that pvc is not getting bound Edit: nevermind, storageClass was not present Also, in the example mentioned in the doc has driver name rook/pkg/operator/ceph/cluster/watcher.go Line 269 in cb44c7b
so, I believe based on code nodeFencing will not be applied to static pv which I think make sense as well since static pv life time is same as pod and in case of nodeLoss pod is gone. |
You need to create static PVC with the same driver deployed by csi driver. you need to use rbd storageclass with what ever the csi driver is deployed by Rook.
Sorry I didn't get above comment. |
@Madhu-1 NodeFence cr was not created because the code failed to run command
|
You can add a check for |
415bf85
to
2cf9fca
Compare
2cf9fca
to
f4242be
Compare
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
f4242be
to
75308ea
Compare
@@ -262,11 +262,20 @@ func listRBDPV(listPVs *corev1.PersistentVolumeList, cluster *cephv1.CephCluster | |||
var listRbdPV []corev1.PersistentVolume | |||
|
|||
for _, pv := range listPVs.Items { | |||
// Ignore PVs that support multinode access (RWX, ROX), since they can be mounted on multiple nodes. |
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 we keep this 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.
it was mistake, restored, thanks
// Ignore PVs that support multinode access (RWX, ROX), since they can be mounted on multiple nodes. | ||
if pvSupportsMultiNodeAccess(pv.Spec.AccessModes) { | ||
// Skip if pv is not provisioned by CSI | ||
if pv.Spec.CSI == nil { |
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 we can add a function donotPrrovision
and can move all this check there
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.
hmm, this is comparably very small function, I think we can keep in a single function.
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'm glad to see these changes are functionally pretty small. Only a few fairly minor comments
290171c
to
64208a7
Compare
when node fencing is triggered and a negative case where one deployment pod consuming pv not provisioned by csi and another deployment pod with rbd rwo are on the same node and node fencing is triggered. In this case rook operator panics since it is trigger to get field `pv.Spec.CSI.Driver` which will be nil. Also, skip static pv as there is no `imageName` in the spec rbd status command will fail. Signed-off-by: subhamkrai <srai@redhat.com>
64208a7
to
72386eb
Compare
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
rbd: node fencing, skip pv when pv is not backed by csi (backport #12563)
Description of your changes:
when node fencing is triggered and a negative case where one deployment pod consuming pv not provisioned by csi and another deployment pod with rbd rwo are on the same node and node fencing is triggered.
In this case, rook operator panics since it is triggered to get field pv.Spec.CSI.Driver which will be nil
Which issue is resolved by this Pull Request:
Resolves #12558
Checklist:
skip-ci
on the PR.