-
Notifications
You must be signed in to change notification settings - Fork 159
Errors creating PersistentVolumeClaim over 63 characters #1160
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
Comments
I can confirm this issue. For us it surfaces when using the prometheus operator:
|
In our code:
And for tags there is also a restriction of value length 63: https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing This should get fixed too |
The tag change has already been in 1.8.x, if you have a long PVC name the tag creation should fail already? |
There are no issues with tags because the tags are not being used as tags in GCP but instead are encoded and set for the description. And my GCP project has not enabled the Tags feature. For example, one of my disks in GCP shows this for description: {
"kubernetes.io/created-for/pv/name": "pvc-0c30ce13-d330-4fab-b930-7409cab4090a",
"kubernetes.io/created-for/pvc/name": "mysql-data-restore-mysql-sample-8027-to-8028-2",
"kubernetes.io/created-for/pvc/namespace": "instance-upgrade-tests",
"storage.gke.io/created-by": "pd.csi.storage.gke.io"
} |
These strings are all less than 63 characters?
|
That's an example from a working disk, meant to illustrate what the driver was already doing pre-1.9 - I think. The problem described in the original issue prevents creation of PDs from PVCs with long (>63 chars) disks because they violate the label length restrictions on the GCP side, the PD is never created and consuming pods stay pending. For reference, this is a PD created by driver version 1.9.1 - its name isn't longer than 63 characters so everything works.
When a PVC has a name longer than 63 characters, the driver throws an error, and no disk is created. Specifically, the label |
If I may offer my take on a solution to this problem which doesn't involve having (GKE, or roll-your-own) downstream customers rewrite their configuration to stay within the 63 character limit, it would be great if this new auto-labelling mechanism had a feature toggle so it could be opted out of. Silently dropping the labels if they are too long, or truncating them to 63 characters, might surprise people who decide to use them in automation or somesuch. Either way, leaving this as is will lead to a lot of time spent figuring out why pods stay pending, because the first error message only appears in the pod status 5 minutes after it being scheduled and is a rather vague hint about a timeout while waiting for a volume to be provisioned. To find the actual root cause, you have to check the PD driver logs. |
Yes, my example above was to show how the tags were used to build the description and not actually used as tags on the GCP resource. I can create a PVC with a name longer than 63 characters before using 1.9.0.
However, one caveat is that I actually have 1.7.2 deployed because stable-master/image.yaml is not pointing at the right tag in the v1.8.2 tagged release. |
Discussed offline, we will revert this PR and create a new 1.9.2 release with the revert. @Sneha-at will take a look when back from vacation. |
@sunnylovestiramisu @Sneha-at Adding "namespace" and "pv/pvc name" labels to gcp disks is an extremely useful feature. Please, add a fix to cut everything out of 64 letters instead of disabling such labels entirely! |
@pia-drcash we would be able to keep "namespace name" labels but are facing issue with "PV/PVC name" labels. Do you need the PV/PVC name labels too? If we truncate names at 64 we will not be able to uniquely identify the PV/PVCs. Could share your use case for both "PV" and "PVC" name labels |
It is going to be a lot more reliable to parse this data from the JSON in the disks' descriptions if you want to use this info in automation. See this post above for info. |
Hello,
I noticed the label change in 1.9.0 has started causing failures when I request a PVC with a long name.
For example, I have a storage class like such:
I have installed the 1.9.0 CSI driver
When I create a PersistentVolumeClaim with a long name:
I see the PVC is stuck in Pending and there is an error about label length:
I see in the change from #1090 that the PVC, PV, and namespace name that were used in the disk description are now being added as labels to the disk.
But this poses a problem because Kubernetes resource names can be up to 254 characters while GCP resources can only have labels up to 64 characters.
For now we will pin our CSI driver to 1.8.2 to unblock ourselves but we would appreciate a fix or workaround so we can continue to use the stable release.
The text was updated successfully, but these errors were encountered: