【问题标题】:How to specify availability zone with AWS EKS Fargate cluster with eckctl?如何使用 eckctl 使用 AWS EKS Fargate 集群指定可用区?
【发布时间】:2021-02-09 23:53:00
【问题描述】:

我正在学习 Kubernetes,并尝试使用以下配置简单文件创建 AWS EKS Fargate 集群

kind: ClusterConfig
apiVersion: eksctl.io/v1alpha5

metadata:
  name: sandbox
  region: us-east-1
  version: "1.18"

fargateProfiles:
  - name: fp-default
    selectors:
      # All workloads in the "default" Kubernetes namespace will be
      # scheduled onto Fargate:
      - namespace: default
      # All workloads in the "kube-system" Kubernetes namespace will be
      # scheduled onto Fargate:
      - namespace: kube-system
  - name: fp-sandbox
    selectors:
      # All workloads in the "sandbox" Kubernetes namespace matching the
      # following label selectors will be scheduled onto Fargate:
      - namespace: sandbox
        labels:
          env: sandbox
          checks: passed
  - name: fp-fluxcd
    selectors:
      # All workloads in the "fluxcd" Kubernetes namespace matching the
      # following label selectors will be scheduled onto Fargate:
      - namespace: fluxcd

我收到以下错误。如何在上面的配置文件中指定可用区?

[✖]  AWS::EKS::Cluster/ControlPlane: CREATE_FAILED – "Cannot create cluster 'sandbox' because us-east-1a, the targeted availability zone, does not currently have sufficient capacity to support the cluster. Retry and choose from these availability zones: us-east-1b, us-east-1c, us-east-1d, us-east-1e, us-east-1f (Service: AmazonEKS; Status Code: 400; Error Code: UnsupportedAvailabilityZoneException; Request ID: 7c5c4544-4fe5-4ed5-96a8-099d60e1e5ab; Proxy: null)"

【问题讨论】:

    标签: kubernetes amazon-eks eksctl


    【解决方案1】:

    请参阅 eksctl config file schema。

    kind: ClusterConfig
    apiVersion: eksctl.io/v1alpha5
    
    metadata:
      name: sandbox
      region: us-east-1
      version: "1.18"
    
    fargateProfiles:
      - name: fp-default
        selectors:
          # All workloads in the "default" Kubernetes namespace will be
          # scheduled onto Fargate:
          - namespace: default
          # All workloads in the "kube-system" Kubernetes namespace will be
          # scheduled onto Fargate:
          - namespace: kube-system
      - name: fp-sandbox
        selectors:
          # All workloads in the "sandbox" Kubernetes namespace matching the
          # following label selectors will be scheduled onto Fargate:
          - namespace: sandbox
            labels:
              env: sandbox
              checks: passed
      - name: fp-fluxcd
        selectors:
          # All workloads in the "fluxcd" Kubernetes namespace matching the
          # following label selectors will be scheduled onto Fargate:
          - namespace: fluxcd
    
    availabilityZones: ['us-east-1b']
    

    【讨论】:

    • 我完全错过了这一点,并为该页面添加了书签并不断查看。谢谢。
    猜你喜欢
    • 2021-07-08
    • 2021-11-21
    • 2020-05-10
    • 2020-11-07
    • 2021-07-09
    • 1970-01-01
    • 2022-10-07
    • 2021-06-03
    • 2020-03-15
    相关资源
    最近更新 更多