-
Notifications
You must be signed in to change notification settings - Fork 159
Add gce disk labels support via storageclass/CreateVolumeRequest parameters #566
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
Add gce disk labels support via storageclass/CreateVolumeRequest parameters #566
Conversation
Welcome @ernestas2k! |
Hi @ernestas2k. Thanks for your PR. I'm waiting for a kubernetes-sigs 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: ernestas2k 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 |
/assign @mattcary |
/ok-to-test |
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.
Thanks for your PR!
A couple of minor nits, LMK what you think.
@@ -55,6 +55,7 @@ See Github [Issues](https://github.com/kubernetes-sigs/gcp-compute-persistent-di | |||
|------------------|---------------------------|---------------|----------------------------------------------------------------------------------------------------| | |||
| type | `pd-ssd` OR `pd-standard` | `pd-standard` | Type allows you to choose between standard Persistent Disks or Solid State Drive Persistent Disks | | |||
| replication-type | `none` OR `regional-pd` | `none` | Replication type allows you to choose between Zonal Persistent Disks or Regional Persistent Disks | | |||
| labels | `key1=value1,key2=value2` | | Labels allow you to assign custom GCE Disk labels | |
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.
(dropping some notes here for future reference)
naming looks good, 'labels' is consistent with GCP label APIs:
https://cloud.google.com/sdk/gcloud/reference/compute/disks/add-labels
https://cloud.google.com/resource-manager/docs/creating-managing-labels
Thanks @mattcary for fast feedback. I agree with all of the observations and I'll prepare updates. Regarding the validation, absolutely let's do it, with slight caveat that changes on google side will have to be reflected in the code too (hopefully labels api won't change often). Also, is there any integration test that I should update or actually introduce for this feature? The kubernetes-integration and verify jobs failed: Is there anything to be done from my side regarding these failures? PS: just pushed newest changes to address the comments (please take a look if you are ok with regexps, error messages, etc). I'm ready to rework it so it's not too different from other functionality. |
fd49af1
to
957e733
Compare
Great, thanks.
That's a great question. The storage class test/k8s-integrations/configs/sc-standard.yaml is what gets used for the integration tests, adding a label there would be a good idea.
It succeeded after your last push. You can run it manually with hack/verify-all.sh.
Trying again later :-)
Will look shortly, thanks! |
Awesome, I just added e2e test case What are your thoughts on this? 👍 |
f2f3301
to
371f879
Compare
I prefer adding a new test case, if it starts failing it will be a lot easier to tell what's going on; eg if the non-label version is still succeeding than we immediately know what's going on. I think it would be good to add a label to the storage class in test/k8s-integeration/configs. This will be used for the k/k e2e tests and would be good to ferret out if something is depending on the storage class parameters in a way it shouldn't be. Also it will run on real PDs and give us, well, a real e2e test. |
Oops, you did that already. Thanks! |
371f879
to
63a927b
Compare
Updated the PR with requested changes. I appreciate the comments and quick feedback 👍 |
AFAICT we don't have the PV plumbed through so it would be hard to check even if we wanted to. We also would only want to check the labels in the case where the PV was dynamically provisioned, information which we also don't seem to have. Also, if the user were to delete the labels, and we enforced validation, it would be very hard to recreate them correctly. Since AFAIU the labels are used for informational purposes (accounting etc) it would be better to have a tool to recreate them appropriately rather than risk breaking storage usage if they get out of sync. |
@ernestas2k any updates---are you waiting on anything? |
Since the request for supporting the k8s metadata came in late, would it be simpler to split up into two PRs and treat the k8s metadata separately? |
I'm in melancholic autumn mood right now, but since you pinged me I'll address your points this week 👍 . Unless you reconsider and split the task. Until then I'll address all of the points added. |
Thanks! Summer is still in full swing here in Seattle and I still have a month before the autumn rains set in :-) I think if you just make the test improvements Saikat mentioned, I'm okay with leaving the tag addition to a future CL. Let me know if you agree and I'll make in issue to track the tags (we're working on the filestore driver and will be adding labels in the same way). |
Add labels validation to match gce requirements add e2e test case for labels
b11526f
to
31c22b2
Compare
New changes are detected. LGTM label has been removed. |
Just updated the PR, addressed comments on test cases. Regarding kubernetes tags and sanitizing keys/values. Pretty straightforward change, but I would be surprized when strings that I've passed are accepted and silently converted. Take parameter At most, I'd go with sanitizing the predefined keys of tag* constants (for example What are your thoughts? |
But since these labels are actually put on the PDs, what happens if an invalid character is passed through? Will PD creation fail or will something be silently dropped? I think the common case would be that users would prefer to have labels actually created rather than having PD creation fail (which will occur some time after the SC creation and so be hard to debug). We could also think about a validating webhook as is currently being done for snapshotting. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@ernestas2k: 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/test-infra repository. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten |
Just wanted to check if this issue is still being worked on? We are applying different actions on GCE PDs according to the originating StorageClass. However with the description field implemented in #570 i am only able to see the PVC/PV name. Without querying the cluster itself its therefore not possible to get the originating StorageClass. (Or am i missing something?) |
I'll take over this PR and get it in. Watch #340 for the status. /close |
@mattcary: 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/test-infra repository. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds support to assign gce disk labels via storageclass / CreateVolumeRequest parameters.
Which issue(s) this PR fixes:
Fixes #340
Special notes for your reviewer:
Does this PR introduce a user-facing change?: