eksctl icon indicating copy to clipboard operation
eksctl copied to clipboard

[Feature] Check support of subnets for instanceTypes

Open misogihagi opened this issue 1 year ago • 7 comments

I already prepared VPC and subnets. Here is my yaml:

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: test-cluster
  region: ap-northeast-3
managedNodeGroups:
  - spot: true
    instanceTypes:
      - t3.large
      - t3a.large
      - c3.large
      - c4.large
      - c5.large
    name: test-cluster-nodes
vpc:
  subnets:
    public:
      ap-northeast-3a:
        id: subnet-xxxxxxxxxxxxxxxxx
      ap-northeast-3b:
        id: subnet-yyyyyyyyyyyyyyyyy
    private:
      ap-northeast-3a:
        id: subnet-aaaaaaaaaaaaaaaaa
      ap-northeast-3b:
        id: subnet-bbbbbbbbbbbbbbbbb

When deployed, the following error occurs:

2024-02-16 12:02:29 [ℹ]  skipping ap-northeast-3a from selection because it doesn't support the following instance type(s): t3a.large,c3.large
2024-02-16 12:02:29 [ℹ]  deploying stack "eksctl-test-cluster-nodegroup-test-cluster-nodes"
2024-02-16 12:02:29 [ℹ]  waiting for CloudFormation stack "eksctl-test-cluster-nodegroup-test-cluster-nodes"
2024-02-16 12:02:59 [ℹ]  waiting for CloudFormation stack "eksctl-test-cluster-nodegroup-test-cluster-nodes"
2024-02-16 12:03:55 [ℹ]  waiting for CloudFormation stack "eksctl-test-cluster-nodegroup-test-cluster-nodes"
2024-02-16 12:05:11 [ℹ]  waiting for CloudFormation stack "eksctl-test-cluster-nodegroup-test-cluster-nodes"
2024-02-16 12:05:42 [ℹ]  waiting for CloudFormation stack "eksctl-test-cluster-nodegroup-test-cluster-nodes"
2024-02-16 12:05:42 [!]  1 error(s) occurred and cluster hasn't been created properly, you may wish to check CloudFormation console
2024-02-16 12:05:42 [ℹ]  to cleanup resources, run 'eksctl delete cluster --region=ap-northeast-3 --name=test-cluster'
2024-02-16 12:05:42 [✖]  waiter state transitioned to Failure
Error: failed to create cluster "test-cluster"

This is because there is no subnet that satisfies all of these instance types. There are only one or two in any given subnet.

  - t3.large
  - t3a.large
  - c3.large
  - c4.large
  - c5.large

So if not all subnets can meet the instance type, it would be kind to tell the user that there are no subnets available.

misogihagi avatar Feb 16 '24 12:02 misogihagi

Hello misogihagi :wave: Thank you for opening an issue in eksctl project. The team will review the issue and aim to respond within 1-5 business days. Meanwhile, please read about the Contribution and Code of Conduct guidelines here. You can find out more information about eksctl on our website

github-actions[bot] avatar Feb 16 '24 12:02 github-actions[bot]

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Mar 29 '24 01:03 github-actions[bot]

( º︵º )

misogihagi avatar Mar 31 '24 06:03 misogihagi

Hi @misogihagi - AFAIK, instance type offerings are defined at either Region or AZ level. And looking at your logs, I notice eksctl only filters out ap-northeast-3a 👇🏻. This would mean that ap-northeast-3b supports all required instance types.

2024-02-16 12:02:29 [ℹ] skipping ap-northeast-3a from selection because it doesn't support the following instance type(s): t3a.large,c3.large

Can you please share the exact cloudformation error you're getting?

TiberiuGC avatar Apr 08 '24 15:04 TiberiuGC

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar May 09 '24 01:05 github-actions[bot]

I am sorry, but my AWS environment is suspending and I cannot try to deploy. The terraform code looks like this.

provider.tf:

terraform {
  required_providers {
    eksctl = {
      source  = "mumoshu/eksctl"
      version = "0.15.1"
    }
    aws = {
      source = "hashicorp/aws"
      version = "3.30.0"
    }
  }
}
provider "eksctl" {}
provider "aws" {
  region = "ap-northeast-3"
}

main.tf:

data "aws_availability_zones" "available" {
  state = "available"
}

module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "2.77.0"

  name = "canary-test-vpc"
  cidr = "10.0.0.0/16"

  azs             = data.aws_availability_zones.available.names
  private_subnets = ["10.0.1.0/24", "10.0.2.0/24"]
  public_subnets  = ["10.0.101.0/24", "10.0.102.0/24"]

  enable_nat_gateway = true
}

resource "eksctl_cluster" "main" {
  name          = "test_cluster"
  region         = "ap-northeast-3"
  vpc_id = module.vpc.vpc.id
  spec = <<-EOS
  managedNodeGroups:
    - spot: true
      instanceTypes:
        - t3.large
        - t3a.large
        - c3.large
        - c4.large
        - c5.large
      name: test-cluster-nodes
  vpc:
    subnets:
      public:
        ap-northeast-3a:
          id: ${module.vpc.public_subnets[0].id}
        ap-northeast-3b:
          id: ${module.vpc.public_subnets[1].id}
      private:
        ap-northeast-3a:
          id: ${module.vpc.private_subnets[0].id}
        ap-northeast-3b:
          id: ${module.vpc.private_subnets[1].id}
  EOS
}

Anyway, nothing satisfies the condition of all instance types. eksctl generates cloudformation without instance type.

misogihagi avatar May 10 '24 11:05 misogihagi

Related to https://github.com/eksctl-io/eksctl/issues/7064

TiberiuGC avatar May 15 '24 17:05 TiberiuGC

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jun 15 '24 01:06 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jun 21 '24 01:06 github-actions[bot]