-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Spec update of Block volume to support for dynamic provisioning #1595
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
Conversation
|
@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:
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. |
fe498b4 to
3b5f713
Compare
|
@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. |
|
@jsafrane |
3b5f713 to
9bf1128
Compare
df28078 to
8671dfc
Compare
|
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 |
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 you outline both for internal and external, what happens if the plugin does not support block?
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.
done.
8671dfc to
5a737af
Compare
| 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. |
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.
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?
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.
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?
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.
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?
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.
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.
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.
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
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.
updated.
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.
+events on the PVC and the PVC is Pending forever (or until admin fixes either internal or external provisioner)
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.
@jsafrane
Which line are you suggesting to add above 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's just for the comment above, the proposal itself is OK.
9745cf9 to
92855d5
Compare
|
@msau42, @screeley44, do you have any more comments or is this good enough to be merged? |
|
lgtm |
1 similar comment
|
lgtm |
|
lgtm great job @mtanino |
erinboyd
left a 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.
In example 2 remove ext4
This commits update current specification of Block volume to support dynamic provisioning functionality.
92855d5 to
c4e1df2
Compare
|
@erinboyd On the other hands, in the |
|
/lgtm |
|
/assign @saad-ali |
|
/lgtm |
|
[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 |
Spec update of Block volume to support for dynamic provisioning
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