Skip to content
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

Merged
merged 1 commit into from Nov 7, 2022

Conversation

Rakshith-R
Copy link
Contributor

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 rar@redhat.com

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 <rar@redhat.com>
@Rakshith-R
Copy link
Contributor Author

This pr is ready for review.
It successfully sets up encryption whenever previous requests fail before doing so.

refer:
#3472 (comment)

Copy link
Member

@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.

I think this looks good. Can you explain how you tested/verified this?

@Rakshith-R
Copy link
Contributor Author

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.
Copy link
Collaborator

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?

Copy link
Contributor Author

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

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?

Copy link
Collaborator

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.
Copy link
Collaborator

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?

@Madhu-1 Madhu-1 added the ok-to-test Label to trigger E2E tests label Nov 7, 2022
@github-actions
Copy link

github-actions bot commented Nov 7, 2022

/test ci/centos/k8s-e2e-external-storage/1.23

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

/test ci/centos/k8s-e2e-external-storage/1.24

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

/test ci/centos/k8s-e2e-external-storage/1.25

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

/test ci/centos/mini-e2e-helm/k8s-1.23

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

/test ci/centos/mini-e2e-helm/k8s-1.24

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

/test ci/centos/mini-e2e-helm/k8s-1.25

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

/test ci/centos/mini-e2e/k8s-1.23

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

/test ci/centos/mini-e2e/k8s-1.24

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

/test ci/centos/mini-e2e/k8s-1.25

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

/test ci/centos/upgrade-tests-cephfs

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

/test ci/centos/upgrade-tests-rbd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/rbd Issues related to RBD ok-to-test Label to trigger E2E tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crashes during CreateVolume: Pods failing with "unexpected encryption status"
3 participants