-
Notifications
You must be signed in to change notification settings - Fork 163
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
PVC Creation fails for default storage classes #979
Comments
@abhinandanbaheti Thanks for reporting this. I will try to reproduce and deliver a fix. |
Which Kubernetes Version are you running? I can't replicate it with > 1.25. According to the docs:
In my tests, the storageClass attribute was set directly with the cluster default storageClass |
Hey @oliverbaehler thanks for the response. We're running 1.24 currently |
@logikone A specific distribution or something like that? I am unable to confirm that issue with KinD 1.24.0 |
Hey, it took me a while but i've finally been able to repo this issue. for some of our pvcs we have the I think we need to look in both places for the storage class until support for the annotation is fully removed, which I suspect might be a bit as per this comment: kubernetes/kubernetes#51440 (comment) which is already over 5 years old 😢 |
i'm not able to repro this in testing using the e2e test suite in this repo. still digging to try and figure out whats going on |
Are you using a specific distro or do you have any custom FeatureGates enabled? |
its just the standard k8s dist, installed by kops. for whatever reason when the annotation is present on a pvc the request gets denied by the |
@oliverbaehler we're doing something similar to Ingress objects, where the annotation is still used for previous Kubernetes versions. don't you think we should add this also for PVCs? |
Bug description
PVC Creation fails for default storage classes
How to reproduce
Steps to reproduce the behavior:
` storageOptions:
matchExpressions:
operator: Exists
`
Warning FailedCreate 2m29s (x177 over 6h57m) statefulset-controller create Pod test-20 in StatefulSet test failed error: failed to create PVC file-test-20: admission webhook "pvc.capsule.clastix.io" denied the request: A valid Storage Class must be used: matching the label selector defined in the Tenant
Expected behavior
PVC creation should be successful, because if we don't specify storage class name in volumeClaimtemplates, kubernetes picks up the default storageclass and set it in annotation (volume.beta.kubernetes.io/storage-class) in PVC, but since capsule checks that pvc must have the storageClassName in the spec it fails. We should also add a check for the annotation (volume.beta.kubernetes.io/storage-class) with the valid storage class name, and if its present then allow the request to create pvc.
Sample code
https://github.com/projectcapsule/capsule/blob/main/pkg/webhook/pvc/validating.go#L48-L56
The text was updated successfully, but these errors were encountered: