【问题标题】:Kubernetes StorageClass not found未找到 Kubernetes StorageClass
【发布时间】:2018-05-01 03:53:17
【问题描述】:

我遇到了动态存储配置程序的问题。 我已经创建了存储类(已编辑)

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

当我创建一个引用其中一个存储类的 pvc 时,它会失败

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

知道为什么它会失败

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

这里是慢速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

【问题讨论】:

  • 你能用kubectl get -o yaml sc slow更新你的问题吗?我的假设是slow 可能与storageclass.storage.k8s.io 位于不同的apiVersion
  • 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
  • @MatthewLDaniel 用 get -o yaml 更新了慢存储类的问题
  • 您的 apiservers 的 --enable-admission-plugins 中有 DefaultStorageClass 吗?
  • @MatthewLDaniel 是的,我启用了它。 --admission-control=DefaultStorageClass,NamespaceLifecycle,LimitRanger,ServiceAccount,ResourceQuota,PodPreset,Initializers,MutatingAdmissionWebhook,ValidatingAdmissionWebhook

标签: kubernetes storage-class-specifier persistent-volumes kubernetes-pvc


【解决方案1】:

好的。我找到了答案。我没有启用存储 api 作为 apiserver 的 runtimeconfigs 的一部分

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

添加以上行解决了问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-05-05
    • 2018-02-16
    • 1970-01-01
    • 2019-05-06
    • 1970-01-01
    • 2020-09-09
    • 2021-10-24
    • 2021-09-04
    相关资源
    最近更新 更多