1

我在任何地方都找不到我创建的卷,我检查了所有 AWS-EU 区域,但什么也没有。

这是我的 YAML:

# apiVersion: v1
# kind: PersistentVolumeClaim
# metadata:
#   name: m1-operation-volume-pvc
#   annotations:
#     volume.beta.kubernetes.io/storage-class: retain-aws-storage-class
# spec:
#   accessModes:
#   - ReadWriteMany
#   resources:
#     requests:
#         storage: 50Gi

# ---

# kind: PersistentVolume
# apiVersion: v1
# metadata:
#   name: m1-operation-persistent-volume
#   labels:
#     type: local
# spec:
#   storageClassName: retain-aws-storage-class
#   capacity:
#     storage: 50Gi
#   accessModes:
#     - ReadWriteMany
#   hostPath:
#     path: "/mnt/m1-persistent-volume"


# ---

# apiVersion: storage.k8s.io/v1
# kind: StorageClass
# metadata:
#   name: retain-aws-storage-class
# parameters:
#   type: gp2
#   zone: eu-west-1
#   fsType: ext4
# provisioner: kubernetes.io/aws-ebs
# reclaimPolicy: Retain
# allowVolumeExpansion: true
# mountOptions:
#   - debug
# volumeBindingMode: Immediate

如您所见,我StorageClass有一个参数zone: eu-west-1,但该区域根本没有 50Gi 卷。任何人都可以解释可能导致此问题的原因吗?

kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                    STORAGECLASS               REASON   AGE
m1-operation-persistent-volume            50Gi       RWX            Retain           Bound    jx-develop/m1-operation-volume-pvc      retain-aws-storage-class            8h

kubectl get pvc
NAME                       STATUS   VOLUME                            CAPACITY   ACCESS MODES   STORAGECLASS               AGE
m1-operation-volume-pvc   Bound    m1-operation-persistent-volume   50Gi       RWX            retain-aws-storage-class   8h

我的猜测可能gp2是不喜欢- ReadWriteMany,或者我的 pod 没有完全启动并运行,这就是它没有创建 Volume 的原因?但是说 STATUSBound意味着它是创建和有界的...... spec.containers下的部署值:

volumeMounts:
- mountPath: "/mnt/m1-persistent-volume"
  name: "m1-operation-volume"

  volumes:
  - name: m1-operation-volume
    persistentVolumeClaim:
      claimName: m1-operation-volume-pvc

我的pod

kubectl get pods
jx-m1-operations-***-**        0/1     CrashLoopBackOff   127        8h

当我描述由于探测检查而pod失败时,它与应用程序相关,而不是卷......ReadinessLiveness/health

我仍然需要在ELASTIC BLOCK STOREAWS-UI 卷列表下查看它。

任何想法,我的音量在哪里?或者它可能是从 EKS 集群资源(本地)分配的......?

4

0 回答 0