Skip to content

Conversation

@mtanino
Copy link

@mtanino mtanino commented Jan 12, 2018

This PR updates current specification of Block volume to support dynamic provisioning functionality.

Initial design doc proposal for block volume: #1265
Feature issue: kubernetes/enhancements#351

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 12, 2018
@k8s-github-robot k8s-github-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label Jan 12, 2018
@mtanino
Copy link
Author

mtanino commented Jan 12, 2018

/cc @msau42 @erinboyd @screeley44 @jsafrane
@jingxu97 @rootfs

Please give feedback for the update of dynamic provisioning support, thanks.

@k8s-ci-robot
Copy link
Contributor

@mtanino: GitHub didn't allow me to request PR reviews from the following users: erinboyd.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @msau42 @erinboyd @screeley44 @jsafrane
@jingxu97 @rootfs

Please give feedback for the update of dynamic provisioning support, thanks.

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.

@k8s-ci-robot k8s-ci-robot requested a review from jsafrane January 12, 2018 20:12
@mtanino mtanino force-pushed the raw-block-dyn-support branch from fe498b4 to 3b5f713 Compare January 12, 2018 20:26
@jsafrane
Copy link
Member

@mtanino, can you please update also "Out of tree provisioning" section in contributors/design-proposals/storage/volume-provisioning.md so we have the whole protocol in one document?

Otherwise this PR is OK.

@mtanino
Copy link
Author

mtanino commented Jan 15, 2018

@jsafrane
Good catch. I'll also update volume-provisioning.md. Thanks.

@mtanino mtanino force-pushed the raw-block-dyn-support branch from 3b5f713 to 9bf1128 Compare January 15, 2018 19:16
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 15, 2018
@mtanino mtanino force-pushed the raw-block-dyn-support branch 2 times, most recently from df28078 to 8671dfc Compare January 15, 2018 19:41
@mtanino
Copy link
Author

mtanino commented Jan 15, 2018

@jsafrane

@mtanino, can you please update also "Out of tree provisioning" section in contributors/design-proposals/storage/volume-provisioning.md so we have the whole protocol in one document?

Updated.

@jsafrane
Copy link
Member

Thanks! LGTM, however I'd appreciate if someone else looks at it too. If not, let's merge it say early next week.

provisioners. Therefore, in order to create block volume, provisioners need to support
`volumeMode` and then create persistent volume with `volumeMode`.

As for the external provisioner case, admin have to carefully provide Kubernetes environment
Copy link
Member

Choose a reason for hiding this comment

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

Can you outline both for internal and external, what happens if the plugin does not support block?

Copy link
Author

Choose a reason for hiding this comment

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

done.

@mtanino mtanino force-pushed the raw-block-dyn-support branch from 8671dfc to 5a737af Compare January 16, 2018 22:58
If a storage and plugin don't have an ability to create raw block type of volume,
then `both internal and external provisioner don't need any update` to support `volumeMode`
because `volumeMode` in PV and PVC are automatically set to `Filesystem` as a default when
these volume object are created.
Copy link
Member

Choose a reason for hiding this comment

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

So IIUC, a volume will be created, but because the volumeMode is filesystem, it won't bind to the PVC. So PVC will stay pending forever. And then it's up to the user to manually delete the provisioned PVs? Is there anyway we can propagate some type of error to make it more clear to the user what's wrong?

Copy link
Author

Choose a reason for hiding this comment

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

@msau42 @jsafrane

Good catch. This is a problem, we should provide solution as you mentioned.

Can pv_controller check created volume object after Provision()?
Seems if plugin uses internal provisioner, pv_controller have a chance to inspect whether requested volumeMode in PVC and volumeMode in PV are same or not, so that we can add inspection and show error if they don't match.

But if plugin uses external-provisioner, do we have a chance to inspect PV and show error same as internal provisioner?

Copy link

@screeley44 screeley44 Jan 17, 2018

Choose a reason for hiding this comment

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

so not sure I know of an easy way to catch and handle this other than somehow letting the user know via an event that they supplied volumeMode in their pvc but there are currently no supported plugins or matching volumes.

So in the pv-controller --> index.go, we try to find matchingVolumes based on claimSpecs, etc... We perform this check on misMatchingVolumeModes and maybe we can flag that there is a volumeMode mismatch, if that flag is flipped on and there are no matches meaning we return:

nil, nil (no volume, no error)

maybe we return instead:

nil, <some error type message>

so the caller can see no volume was returned but an error was returned and the caller can handle appropriately

(or another return value indicating that we did find volumeMode being used but did not find a matching volume):

nil, nil, <some message saying plugin may not support volumeMode or no volumes exist">

and maybe then let's put that into an event into the pv and pvc?

Just thinking outloud? @msau42 @jsafrane @mtanino any thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah for external provisioners, probably the best you can do is generate an event if the PV is prebound to the PVC and if volume mode doesn't match.

Copy link
Author

Choose a reason for hiding this comment

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

@screeley44 @msau42

IIUC, the conclusions are;

  • For internal provisioner
    Check of mismatching volumeMode between PV spec and PVC spec after provision
    pv_controller.go

  • For external provisioner
    Check of mismatching volumeMode between PV spec and PVC spec when pv_controller finds matching volumes based on claimSpecs
    index.go

Copy link
Author

@mtanino mtanino Jan 18, 2018

Choose a reason for hiding this comment

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

updated.

Copy link
Member

@jsafrane jsafrane Jan 19, 2018

Choose a reason for hiding this comment

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

+events on the PVC and the PVC is Pending forever (or until admin fixes either internal or external provisioner)

Copy link
Author

Choose a reason for hiding this comment

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

@jsafrane
Which line are you suggesting to add above comment?

Copy link
Member

Choose a reason for hiding this comment

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

It's just for the comment above, the proposal itself is OK.

@jsafrane
Copy link
Member

@msau42, @screeley44, do you have any more comments or is this good enough to be merged?

@msau42
Copy link
Member

msau42 commented Jan 29, 2018

lgtm

1 similar comment
@screeley44
Copy link

lgtm

@erinboyd
Copy link
Contributor

lgtm great job @mtanino

Copy link
Contributor

@erinboyd erinboyd left a comment

Choose a reason for hiding this comment

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

In example 2 remove ext4

This commits update current specification of Block volume
to support dynamic provisioning functionality.
@mtanino mtanino force-pushed the raw-block-dyn-support branch from 92855d5 to c4e1df2 Compare January 29, 2018 23:41
@mtanino
Copy link
Author

mtanino commented Jan 29, 2018

@erinboyd
Thanks.
To avoid confusion, I removed the line 357 fsType: ext4 from the Example 2) the created PV: of volume-provisioning.md

On the other hands, in the raw-block-pv.md side, we mention below. Therefore I think example of provisioner could have FSType. This makes implementation of provisioner simpler since provisioner doesn't need to change plugin's volumeSource depends on volumeMode.

+Regardless of the volumeMode, provisioner can set `FSType` into the plugin's volumeSource
+but the value will be ignored at the volume plugin side if `volumeMode` is `Block`.

@jsafrane
Copy link
Member

/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 30, 2018
@mtanino
Copy link
Author

mtanino commented Jan 30, 2018

/assign @saad-ali

@saad-ali
Copy link
Member

saad-ali commented Feb 1, 2018

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane, mtanino, saad-ali

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your 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, 2018
@k8s-ci-robot k8s-ci-robot merged commit 2c7ff0d into kubernetes:master Feb 1, 2018
@mtanino
Copy link
Author

mtanino commented Feb 15, 2018

MadhavJivrajani pushed a commit to MadhavJivrajani/community that referenced this pull request Nov 30, 2021
Spec update of Block volume to support for dynamic provisioning
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. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants