我的 PVC 一直处于Pending
状态。
kubectl describe pvc project-s3-pvc
给出:
Name: project-s3-pvc
Namespace: default
StorageClass: gp2
Status: Pending
Volume:
Labels: <none>
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{},"name":"project-s3-pvc","namespace":"default"},"spec":{"ac...
volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/aws-ebs
Finalizers: [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
Events: <none>
Mounted By: project-s3-86ccd56868-skvv5
✔ /data/project [kubernetes-aws L|✚ 10⚑ 66
kubectl get storageclass
给出:
NAME PROVISIONER AGE
default kubernetes.io/aws-ebs 1h
gp2 (default) kubernetes.io/aws-ebs 1h
我正在运行由 Kops 启动的 1 个节点集群:
kops create cluster --node-count 0 --zones eu-west-1a ${NAME} --master-size t2.large
# Change size from 2 to 0, since above node-count does seem to be ignored
kops edit ig --name=${NAME} nodes
kops edit cluster ${NAME}
# Add this to cluster specification
iam:
allowContainerRegistry: true
legacy: false
kops update cluster ${NAME} --yes
kubectl taint nodes --all node-role.kubernetes.io/master-node
然后我添加 PVC,例如:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: bomcheck-s3-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 30Gi
科普版:Version 1.11.0 (git-2c2042465)
编辑:当我尝试手动创建 PV 时:
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-manual
spec:
accessModes:
- ReadWriteOnce
awsElasticBlockStore:
fsType: ext4
persistentVolumeReclaimPolicy: Delete
storageClassName: gp2
capacity:
storage: 30Gi
我得到:ValidationError(PersistentVolume.spec.awsElasticBlockStore): missing required field "volumeID" in io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource;
这是否意味着我需要在 AWS 中手动创建卷?我希望通过动态配置来增加音量。
知道如何调试为什么不能代表我的 AWS 预置 PVC/PV 吗?