gpt4 book ai didi

amazon-web-services - K8s动态卷配置:AWS上的动态配置不支持claim.Spec.Selector

转载 作者:行者123 更新时间:2023-12-02 12:28:10 25 4
gpt4 key购买 nike

这是我的存储类配置

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
storageclass.kubernetes.io/is-default-class: "false"
name: gp2
provisioner: kubernetes.io/aws-ebs
parameters:
type: gp2
fsType: ext4
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true

并使用AWS ebs创建持久卷。

部署时,永久卷声明失败,并显示以下错误
ProvisioningFailed     persistentvolumeclaim/storage-fabric-orderer0   Failed to provision volume with StorageClass "gp2": claim.Spec.Selector is not supported for dynamic provisioning on AWS

预配置程序已在我的集群中启动并运行
ebs-csi-controller-585596ff6f-2csq4       4/4     Running   0          16m
ebs-csi-controller-585596ff6f-pw9qt 4/4 Running 0 16m
ebs-csi-node-k85xf 3/3 Running 0 16m

光伏文件
apiVersion: v1
kind: PersistentVolume
metadata:
name: ec1-default-ics-dev-alz-fabric-bc-pvol-storage-uk-bcpeer
labels: {"app.kubernetes.io/component":"fabric-bc","app.kubernetes.io/id":"uk-bcpeer","app.kubernetes.io/name":"ec1-default-ics-dev-alz-fabric-bc-pvol-storage-uk-bcpeer","app.kubernetes.io/type":"storage","fabric/organization":"org1","fabric/organization-name":"uk","failure-domain.beta.kubernetes.io/region":"eu-central-1","failure-domain.beta.kubernetes.io/zone":"eu-central-1a","replica-index":"0"}
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteOnce
storageClassName: gp2
awsElasticBlockStore:
volumeID: vol-0b0e325a942392d7f
fsType: ext4

PV claim
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ list "storage" . | include "fabric-orderer.pvc" }}
labels:
{{ include "fabric-orderer.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
app.kubernetes.io/component: {{ .Values.dlt.component }}
type: storage
fabric/organization: {{ .Values.dlt.organization }}
replica-index: {{ .Values.dlt.organizationIndex | print | toJson }}
storageClassName: "gp2"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.persistentVolume.storageSize }}

最佳答案

不应在PVC yaml中将spec.selector设置为在AWS中进行动态配置,因为它不受支持。您需要从PVC yaml中删除此部分。

spec:
selector:
matchLabels:
app.kubernetes.io/component: {{ .Values.dlt.component }}
type: storage
fabric/organization: {{ .Values.dlt.organization }}
replica-index: {{ .Values.dlt.organizationIndex | print | toJson }}

来自 docs

Note: Currently, a PVC with a non-empty selector can’t have a PV dynamically provisioned for it.

关于amazon-web-services - K8s动态卷配置:AWS上的动态配置不支持claim.Spec.Selector,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61122011/

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