Kubernetes StorageClass not found

10,093

ok. I found the answer. I didnt enable the storage api as part of runtimeconfigs for apiserver

--runtime-config=storage.k8s.io/v1=true

Adding the above line solved the issue

Share:
10,093
Prashant
Author by

Prashant

Updated on July 09, 2022

Comments

  • Prashant
    Prashant almost 2 years

    I am facing issues with Dynamic Storage provisioner. I have created storage class (edited)

    kubectl get sc
    NAME                 PROVISIONER             AGE
    slow                 kubernetes.io/aws-ebs   12m
    standard (default)   kubernetes.io/aws-ebs   14m
    

    when i create a pvc referring to one of the storage classes, it fails

    kubectl describe pvc mypvc
    Name:          mypvc
    Namespace:     default
    StorageClass:  slow
    Status:        Pending
    Volume:
    Labels:        <none>
    Annotations:   <none>
    Finalizers:    []
    Capacity:
    Access Modes:
    Events:
    Type     Reason              Age   From                         Message
    ----     ------              ----  ----                         -------
    Warning  ProvisioningFailed  8s    persistentvolume-controller  
    storageclass.storage.k8s.io "slow" not found
    

    Any idea why it fails with

    storageclass.storage.k8s.io "slow" not found
    

    Here is the describe of slow sc

    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      creationTimestamp: 2018-04-27T22:19:49Z
      name: slow
      resourceVersion: "665900"
      selfLink: /apis/storage.k8s.io/v1/storageclasses/slow
      uid: 19ab37b5-4a69-11e8-8f68-021e47d98090
    parameters:
      fsType: ext4
      iopsPerGB: "10"
      type: io1
    provisioner: kubernetes.io/aws-ebs
    reclaimPolicy: Delete
    
    • mdaniel
      mdaniel about 6 years
      Can you update your question with kubectl get -o yaml sc slow; my hypothesis is that slow might be in a different apiVersion from storageclass.storage.k8s.io
    • Prashant
      Prashant about 6 years
      kubectl get sc slow -o yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: creationTimestamp: 2018-04-27T22:19:49Z name: slow resourceVersion: "665900" selfLink: /apis/storage.k8s.io/v1/storageclasses/slow uid: 19ab37b5-4a69-11e8-8f68-021e47d98090 parameters: fsType: ext4 iopsPerGB: "10" type: io1 provisioner: kubernetes.io/aws-ebs reclaimPolicy: Delete
    • Prashant
      Prashant about 6 years
      @MatthewLDaniel Updated the question with the get -o yaml for slow storageclass
    • mdaniel
      mdaniel about 6 years
      Do you have DefaultStorageClass in the --enable-admission-plugins for your apiservers?
    • Prashant
      Prashant almost 6 years
      @MatthewLDaniel Yes, i have it enabled. --admission-control=DefaultStorageClass,NamespaceLifecycle,L‌​imitRanger,ServiceAc‌​count,ResourceQuota,‌​PodPreset,Initialize‌​rs,MutatingAdmission‌​Webhook,ValidatingAd‌​missionWebhook