-
Notifications
You must be signed in to change notification settings - Fork 547
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: setup encryption if rbdVol exits during CreateVol #3422
Conversation
This commit adds code to setup encryption on a rbdVol being repaired in a followup CreateVolume request. This is fixes a bug wherein encryption metadata may not have been set in previous request due to container restart. Fixes: ceph#3402 Signed-off-by: Rakshith R <[email protected]>
e91b849
to
4bda0a5
Compare
This pr is ready for review. refer: |
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 think this looks good. Can you explain how you tested/verified this?
Without the fix, Prov would get OOMKilled during set metadata step for DEK and encryption Status, and provisioning would get completed in a followup req with empty encryption status like seen in the issue linked. With fix, provision tries to setupencryption again in subsequent req leading to repeated OOMkills but raising mem limit leads to provisioning of PVC which can be successfully. |
@@ -508,6 +508,15 @@ func (cs *ControllerServer) repairExistingVolume(ctx context.Context, req *csi.C | |||
|
|||
return nil, err | |||
} | |||
|
|||
default: | |||
// setup encryption again to make sure everything is in place. |
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.
Question:
- This is only for PVC. What about the PVC Clone and PVC Snapshot?
- What about the fileEncryption?
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.
Question:
- This is only for PVC. What about the PVC Clone and PVC Snapshot?
For clone
ceph-csi/internal/rbd/rbd_journal.go
Line 337 in 07e9ded
err = parentVol.copyEncryptionConfig(&rv.rbdImage, true) |
For snapshot, just few ones above to copy encryption config
- What about the fileEncryption?
This pr handles for block encryption,
We can handle the same for file encryption in another pr.
@irq0 can you please take a look at 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.
Open an issue so that we dont forget it?
@@ -508,6 +508,15 @@ func (cs *ControllerServer) repairExistingVolume(ctx context.Context, req *csi.C | |||
|
|||
return nil, err | |||
} | |||
|
|||
default: | |||
// setup encryption again to make sure everything is in place. |
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.
Open an issue so that we dont forget it?
/test ci/centos/k8s-e2e-external-storage/1.23 |
/test ci/centos/k8s-e2e-external-storage/1.24 |
/test ci/centos/k8s-e2e-external-storage/1.25 |
/test ci/centos/mini-e2e-helm/k8s-1.23 |
/test ci/centos/mini-e2e-helm/k8s-1.24 |
/test ci/centos/mini-e2e-helm/k8s-1.25 |
/test ci/centos/mini-e2e/k8s-1.23 |
/test ci/centos/mini-e2e/k8s-1.24 |
/test ci/centos/mini-e2e/k8s-1.25 |
/test ci/centos/upgrade-tests-cephfs |
/test ci/centos/upgrade-tests-rbd |
This commit adds code to setup encryption on a rbdVol being repaired in a followup CreateVolume request. This is fixes a bug wherein encryption metadata may not have been set in previous request due to container restart.
Fixes: #3402
Signed-off-by: Rakshith R [email protected]