-
Notifications
You must be signed in to change notification settings - Fork 324
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
fix: add finalizer to prevent volume leakage #1179
base: master
Are you sure you want to change the base?
Conversation
|
Welcome @1978629634! |
Hi @1978629634. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 1978629634 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 |
8024570
to
5cceb43
Compare
5cceb43
to
f5528e4
Compare
6dd1e1c
to
30e8feb
Compare
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.
@1978629634 Thanks a lot for looking into this! I am afraid this is a complex problem and it will need more thoughts.
- It probably belongs to https://github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/
- In ideal case, it should work as user friendly as possible. Today users can simply delete a PVC when it's stuck provisioning and create a new one with a different StorageClass. Kubernetes should do the right thing without leaks and magic annotations. The hard part is to find out how. Or if we expect users to change their behavior, we need really strong arguments.
- Should there be a new PVC field instead of an annotation? Can we expect users to set it correctly? What prevents users from setting it to "disabled / I don't care about leaks"? It's cluster admin who will then need to deal with the leaks, not user. Do we as Kubernetes authors care?
- Should the field be somewhere else, under admin control? Then users can still remove finalizers from their PVCs, creating leaks anyway.
- Should we fix the provisioner in any other way, e.g. create a shadow object copying the PVC and continue calling Provision() until it gets a final response or cluster admin deletes this shadow object?
We need answers to these questions before we implement anything.
cc @msau42 @xing-yang
7822d9c
to
851b715
Compare
851b715
to
7eafefd
Compare
PR needs rebase. 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. |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Add a annotation volume.kubernetes.io/provisioning-consistency to pvc. When the annotation is set to enable, use a finalizer to ensure that the lifecycle of the PVC is consistent with the associated volume, preventing volume leakage.
The finalizer is removed under two conditions:
1.When the annotation volume.kubernetes.io/provisioning-consistency is set to disable on the PVC, or
2.When the associated PV has been provisioned successfully.
Removing the finalizer allows the PVC to be deleted safely without causing the volume to leak.
Which issue(s) this PR fixes:
Fixes #486
Special notes for your reviewer:
Does this PR introduce a user-facing change?: