-
Notifications
You must be signed in to change notification settings - Fork 962
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
Allow in-place update of PVC's storage request #957
Conversation
The Kubernetes API allows in-place edits of a PVC's spec.resources.requests.storage field. This change updates the PVC resource to allow the same. To avoid surfacing this Kubernetes API error to users, the PVC will be recreated if the specified storage value is less than the previously specified value: `spec.resources.requests.storage: field can not be less than previous value` This saves users the trouble of deleting and recreating the PVC themselves.
I'm working on making a test for |
Nice solution so far! Looks good to me :) |
Test the ability to set resources attribute in minikube. Test the ability to do in-place volume expansion in GKE. Wait for deletion, since PVC finalizer can sometimes delay deletion.
Thanks! I got some acceptance tests committed today. I tested them locally using minikube and GKE. The tests pass. TC test is running now too. |
TC test passed. This is the result from a local test run:
|
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.
LGTM!
Great work, @dak1n1! Very nicely done
@dak1n1 Thank you so much for this ! Quick question (I could try myself but I am not sure how to quickly build the provider from the master branch): would this work for dynamic volume ( |
@JordanP unfortunately |
Ok, that's unfortunate for me :p I guess I can always work on a PR ! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Description
The Kubernetes API allows in-place updates of a PVC's
spec.resources.requests.storage
field.This commit updates the PVC resource to allow the same.
A PVC's storage request may increase in-place, but the API does not allow it to decrease in place.
Therefore, the provider will recreate the PVC in the case that
requests.storage
decreases.This will shield the user from this specific Kubernetes API error:
...And it provides an additional convenience by handling the delete/re-create automatically.
Acceptance tests
References
#602
Community Note