awslabs / mountpoint-s3-csi-driver

Built on Mountpoint for Amazon S3, the Mountpoint CSI driver presents an Amazon S3 bucket as a storage volume accessible by containers in your Kubernetes cluster.
Apache License 2.0
193 stars 23 forks source link

PVC error "storageClassName does not match". Takes the default gp3 #182

Closed Smana closed 5 months ago

Smana commented 5 months ago

/kind bug

What happened?

Using the static provisioning guide, when the pvc is created it takes automatically the default storageClass gp3

kubectl get sc gp3
NAME            PROVISIONER       RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
gp3 (default)   ebs.csi.aws.com   Delete          WaitForFirstConsumer   true                   153d

And I get this error when I describe the pvc

kubectl describe pvc -n platform text-generation-inference-s3 | grep -A 5 ^Events
Events:
  Type     Reason          Age                   From                         Message
  ----     ------          ----                  ----                         -------
  Warning  VolumeMismatch  2m31s (x62 over 17m)  persistentvolume-controller  Cannot bind to requested volume "text-generation-inference-s3": storageClassName does not match

What you expected to happen?

Expecting the PVCs to be ready and they're not

kubectl get pvc -n platform |grep text
text-embeddings-inference-s3      Pending   text-embeddings-inference-s3               0                         gp3            20m
text-generation-inference-s3      Pending   text-generation-inference-s3               0                         gp3            20m

The PVs are ready

kubectl get pv -n platform|grep text
text-embeddings-inference-s3               10Gi       ROX            Retain           Available                                                                                                                                                      21m
text-generation-inference-s3               10Gi       ROX            Retain           Available                

How to reproduce it (as minimally and precisely as possible)?

Here are the manifests

---
apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    meta.helm.sh/release-name: text-inference
    meta.helm.sh/release-namespace: platform
  labels:
    app.kubernetes.io/instance: text-inference
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: text-generation-inference
    helm.sh/chart: helm-universal-0.0.0
  name: text-generation-inference-s3
spec:
  accessModes:
  - ReadOnlyMany
  capacity:
    storage: 10Gi
  csi:
    driver: s3.csi.aws.com
    volumeAttributes:
      bucketName: <REDACTED>
    volumeHandle: s3-csi-driver-volume
  mountOptions:
  - allow-delete
  - region eu-west-3
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    meta.helm.sh/release-name: text-inference
    meta.helm.sh/release-namespace: platform
  labels:
    app.kubernetes.io/instance: text-inference
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: text-generation-inference
    helm.sh/chart: helm-universal-0.0.0
  name: text-generation-inference-s3
  namespace: platform
spec:
  accessModes:
  - ReadOnlyMany
  resources:
    requests:
      storage: 8Gi
  storageClassName: ""
  volumeName: text-generation-inference-s3

Environment

Smana commented 5 months ago

Nevermind this seems to be caused by a null value for storageClassName

This works

storageClassName: ""

This does not work

storageClassName: