gpt4 book ai didi

amazon-web-services - EKS 中的持久存储无法配置卷

转载 作者:行者123 更新时间:2023-12-05 02:39:00 24 4
gpt4 key购买 nike

我按照 AWS 知识库中的步骤创建持久存储:Use persistent storage in Amazon EKS

很遗憾,PersistentVolume(PV) 未创建:

kubectl get pv
No resources found

当我检查 PVC 日志时,我收到以下配置失败消息:

storageclass.storage.k8s.io "ebs-sc" not found

failed to provision volume with StorageClass "ebs-sc": rpc error: code = DeadlineExceeded desc = context deadline exceeded

我正在使用 Kubernetes v1.21.2-eks-0389ca3


更新:

示例中使用的 storageclass.yaml 将 provisioner 设置为 ebs.csi.aws.com

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: ebs-sc
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer

当我使用@gohm'c 回答更新它时,它创建了一个 pv。

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: ebs-sc
provisioner: kubernetes.io/aws-ebs
parameters:
type: gp2
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer

最佳答案

storageclass.storage.k8s.io "ebs-sc" not found

failed to provision volume with StorageClass "ebs-sc"

安装EBS CSI驱动后需要创建存储类“ebs-sc”,示例:

cat << EOF | kubectl apply -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: ebs-sc
provisioner: ebs.csi.aws.com
parameters:
type: gp3
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer
EOF

参见 here更多选项。

关于amazon-web-services - EKS 中的持久存储无法配置卷,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69290796/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com