首页 > 解决方案 > 如何使用 Fargate 创建 AWS Kubernetes 集群 (EKS)?

问题描述

我正在尝试使用 Fargate 创建一个 Kubernetes 集群。

我正在使用带有 .config 文件的 eksctl(如下)。

如果您有使用 Fargate 创建基本 Kubernetes 集群的配置文件,请分享。

我收到 ROLLBACK,我不明白此错误消息的含义。

No export named eksctl-<name>-cluster::SubnetsPublic found. 

Rollback requested by user.

ROLLBACK_COMPLETE

配置文件:

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: test-kb-cluster-w-fg-profile
  region: us-west-2
  version: "1.19"

vpc:
  subnets:
    private:
      us-west-2a: { id: subnet-<hash> }
      us-west-2b: { id: subnet-<hash> }
      us-west-2c: { id: subnet-<hash> }

nodeGroups:
  - name: test-eks-linux-nodes 
    instanceType: t2.micro
    desiredCapacity: 1

fargateProfiles:
  - name: test-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

如果是

标签: amazon-web-servicesamazon-eksaws-fargate

解决方案


请检查您提到的子网是否正确。对我来说,是不正确的子网导致了同样的问题。

另外,我注意到您只提供私有子网。您可能想查看是否需要在 NG 定义下将 privateNetworking 设置为 true。

privateNetworking: true # if only 'Private' subnets are given, this must be enabled

参考:https ://github.com/weaveworks/eksctl/blob/main/examples/04-existing-vpc.yaml


推荐阅读