-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
Don't assign a storage class to claim when the user asked for a specific volume. #128048
Conversation
Skipping CI for Draft Pull Request. |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: carlory The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…ge class into claim when the user asked for a specific volume.
727f50a
to
c21f112
Compare
@carlory: GitHub didn't allow me to request PR reviews from the following users: iheartNathan. 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-sigs/prow repository. |
/sig storage |
/close |
@carlory: Closed this PR. 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-sigs/prow repository. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
There are 2 approaches to assigning a default storage class to a persistent volume claim (PVC) in Kubernetes when the storage class is not specified in the PVC object. The first approach is to use
DefaultStorageClass
admission plugin which assigns a default storage class to a PVC if the storage class field of the PVC is unset when it is created. The limitation of this approach is that it only works for PVCs created after the admission plugin is enabled and the default storage class existed in the cluster before the PVC was created. The second approach unlocks the limitation of the first approach by leveraging thePV controller
to retroactively assign a default storage class to PVCs when it reconciles the unbound PVC objects if the PVC object does not have a storage class and no user-specified volume name is set.There is a gap between the two approaches on how to handle the PVC when the PVC has a user-specified volume name.
It may make users confused. See kubernetes/website#42288 and kubernetes/website#48200 (comment)
StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned. When a user creates a PVC with a given storage class, if the PVC does not contain a user-specified volume name, the
PV controller
orexternal provisioner
will dynamically provision a PV for the PVC.If a user asks for a given volume, the user must create the PV object manually because the volume won't be dynamically provisioned.
There is a side effect for the user-specified volume case, see kubernetes/website#48200 (comment).
Even if we have clarified the breaking change on the
storage class
field of claim in the KEP, user should assign an empty storage class to the PVC object explicitly when the PVC has an user-specified volume name (static provision).And the website is updated to reflect the change. But some users may still get confused. Why need to assign an empty storage class to the PVC object explicitly when the PVC has an user-specified volume name?
I have a proposal to improve the user experience. It will clear the confusion and make the behavior more consistent and predictable.
DefaultStorageClass
admission plugin does not again assign a default storage class to the PVC object when the PVC has a user-specified volume name.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: