AWS/EKS

『EKS』Cluster생성시 Subnet선언 에러

흑당망고 2022. 8. 12. 15:27

문제

갑자기 No export named eksctl-basic-cluster-cluster::SubnetsPublic found. Rollback requested by user.와 같은 에러가 발생되는 경우가 있다.

이때는 대부분 Cluster config에서 vpc, subnet을 지정한 경우 발생되는 에러이다.

해결

이유는 Subnet을 지정했으나 Node가 Private으로 생성될지 Public으로 생성될지 지정이 안되어있어서

발생되는 에러이다.
privateNetworking: true 부분을 추가해주면 된다.

대충 아래가 예시이다.

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: basic-cluster
  region: ap-northeast-2

vpc:
  subnets:
    public:
      ap-northeast-2a: { id: <Subnet_ID> }
      ap-northeast-2b: { id: <Subnet_ID> }
    private:
      ap-northeast-2a: { id: <Subnet_ID> }
      ap-northeast-2b: { id: <Subnet_ID> }

nodeGroups:
  - name: ng1
    labels: { role: workers1 }
    instanceType: t3.small
    desiredCapacity: 2
    volumeSize: 80
    privateNetworking: true

  - name: ng2
    labels: { role: workers2 }
    instanceType: t3.small
    desiredCapacity: 2
    volumeSize: 80
    privateNetworking: true