简体   繁体   English

无法使用 Kubernetes 中的默认存储 class 在 AWS 上创建持久卷

[英]Unable to create persistent volume on AWS using the default storage class in Kubernetes

I'm trying to create persistent volume (PV) on AWS using the persistent volume claim (PVC) and default storage class (of AWS).我正在尝试使用持久卷声明 (PVC) 和默认存储 class (AWS) 在 AWS 上创建持久卷 (PV)。 But PV does not get created on AWS with the default storage class.但是 PV 不会在 AWS 上使用默认存储 class 创建。 Not sure if it is an AWS issue (not supporting default storage) or Kubernetes.不确定这是 AWS 问题(不支持默认存储)还是 Kubernetes。 If I check the status, PV remains in Pending state.如果我检查状态,PV 仍处于待处理state。

Please refer attached screenshot and my manifest file:-请参考随附的屏幕截图和我的清单文件:-

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: sonar-data
spec:
accessModes:
- ReadWriteOnce
storageClassName: default
resources:
requests:
storage: 31Gi

Events:-活动:-

vinod827@Vinods-MacBook-Pro ~ % kubectl get pv
No resources found in default namespace.
vinod827@Vinods-MacBook-Pro ~ % kubectl get pvc
NAME               STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
sonar-data         Pending                                      default        79m
sonar-extensions   Pending                                      default        79m
vinod827@Vinods-MacBook-Pro ~ % kubectl describe pvc sonar-data
Name:          sonar-data
Namespace:     default
StorageClass:  default
Status:        Pending
Volume:        
Labels:        <none>
Annotations:   <none>
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
Mounted By:    sonarqube-6445dc8747-bbktk
Events:
  Type     Reason              Age                 From                         Message
  ----     ------              ----                ----                         -------
  Warning  ProvisioningFailed  9s (x322 over 80m)  persistentvolume-controller  storageclass.storage.k8s.io "default" not found
vinod827@Vinods-MacBook-Pro ~ % 

Yeah, most likely not.是的,很可能不会。 It depends on how you provisioned your cluster and what your default storage class looks like.这取决于您配置集群的方式以及默认存储 class 的外观。

If you are in AWS you might have to create one for AWS EBS if that's what you would like to use.如果您在 AWS 中,您可能必须为AWS EBS创建一个,如果这是您想要使用的。

You can create any of the other supported ones too , depending on what you have in your infrastructure.您也可以创建任何其他受支持的,具体取决于您的基础架构中的内容。

You can check what you have in your cluster:您可以检查集群中的内容:

$ kubectl get sc default -o=yaml

✌️ ✌️

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM