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

KEP-3141: Prevent unauthorised volume mode conversion #3151

Merged
merged 1 commit into from
Feb 1, 2022

Conversation

RaunakShah
Copy link
Contributor

  • One-line PR description: Prevent unauthorised volume mode conversion when restoring volumes.
  • Other comments:

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 17, 2022
@k8s-ci-robot k8s-ci-robot added the kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory label Jan 17, 2022
@k8s-ci-robot k8s-ci-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label Jan 17, 2022
@xing-yang xing-yang self-assigned this Jan 17, 2022
@xing-yang
Copy link
Contributor

/assign @jsafrane @msau42 @jingxu97 @yuxiangqian

@xing-yang
Copy link
Contributor

/assign @deads2k

@xing-yang
Copy link
Contributor

/assign @liggitt

###### Are there any tests for feature enablement/disablement?

We will add unit tests with and without the feature gate enabled. The expectation
is for new fields in `VolumeSnapshotContent` to be dropped when the feature gate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we should "drop" the new field as we don't have a real feature gate. Maybe we should just ignore the new field if the feature flag is disabled. You can keep this as is. I'll let others comment on this.

@jsafrane
Copy link
Member

/lgtm
/approve
the storage parts

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 27, 2022
@xing-yang
Copy link
Contributor

/assign @enj

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 31, 2022
@xing-yang
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 31, 2022
API spec as well as the control flows of `snapshot-controller` and `external-provisioner`.
`VolumeSnapshotContent` API will include a field that denotes the volume mode of
the volume that the snapshot was created from.
This proposal also introduces a new annotation on the `VolumeSnapshotContent` resource
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we own the API, why make this an annotation?

Copy link
Contributor

@xing-yang xing-yang Jan 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did think about adding this to API as well, but thought an annotation is simpler. I'm open to adding this to API. So we can add allowVolumeModeChange to VolumeSnapshotClass for dynamic provisioning. This field will be copied to allowVolumeModeChange field in VolumeSnapshotContent by the snapshot-controller. For static provisioning, admin needs to set the allowVolumeModeChange field in VolumeSnapshotContent.

@jsafrane what do you think?

logs or events for this purpose.
-->

###### How can someone using this feature know that it is working for their instance?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At what stage will the PVC fail? This may be a challenge to give good feedback when you move to beta. I suggest thinking about this for your alpha implementation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the new feature flag is enabled, external-provisioner will be checking whether allowVolumeModeChange is set to true if the volume mode is changed when creating a PVC from a VolumeSnapshot. If allowVolumeModeChange is set to false, CreateVolume request won't be sent to the CSI driver and a PV won't be created. An event should be reported on PVC indicating "ProvisioningFailed". User can also check external-provisioner logs to find out why the volume is not created.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User can also check external-provisioner logs to find out why the volume is not created.

Pod creating users cannot see this log.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true. They can check events on PVC. We'll need to think more about the troubleshooting part.

@deads2k
Copy link
Contributor

deads2k commented Feb 1, 2022

I suspect the API will get some comments during review about making it a field. I encourage you to spend time on the monitoring and troubleshooting flows during alpha. When transitioning to beta, those areas face scrutiny in PRR.

This PRR is sufficient for alpha.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, jsafrane, RaunakShah

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 1, 2022
@k8s-ci-robot k8s-ci-robot merged commit 090f85c into kubernetes:master Feb 1, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants