找不到Kubernetes StorageClass

时间:2018-05-01 03:53:18

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

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

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

1 个答案:

答案 0 :(得分:0)

确定。我找到了答案。我没有启用存储api作为apiserver

的runtimeconfigs的一部分
--runtime-config=storage.k8s.io/v1=true

添加以上行解决了问题