Kubernetes pod pending when a new volume is attached (EKS)

后端 未结 3 652
暖寄归人
暖寄归人 2021-01-04 11:05

Let me describe my scenario:

TL;DR

When I create a deployment on Kubernetes with 1 attached volume, everything works perfectly. When I create the same depl

3条回答
  •  太阳男子
    2021-01-04 11:40

    Sounds like it's trying to create a volume in an availability zone where you don't have any volumes on. You can try restricting your StorageClass to the availability zones where you have nodes.

    kind: StorageClass
    apiVersion: storage.k8s.io/v1
    metadata:
      name: gp2
      annotations:
        storageclass.kubernetes.io/is-default-class: "true"
    provisioner: kubernetes.io/aws-ebs
    parameters:
      type: gp2
    reclaimPolicy: Retain
    mountOptions:
      - debug
    allowedTopologies:
    - matchLabelExpressions:
      - key: failure-domain.beta.kubernetes.io/zone
        values:
        - us-east-1b
        - us-east-1c
    

    This is very similar to this question and this answer except that the issue described is on GCP and in this case it's AWS.

提交回复
热议问题