Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Check support of subnets for instanceTypes #7562

Open
misogihagi opened this issue Feb 16, 2024 · 7 comments
Open

[Feature] Check support of subnets for instanceTypes #7562

misogihagi opened this issue Feb 16, 2024 · 7 comments
Labels
kind/feature New feature or request

Comments

@misogihagi
Copy link

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 misogihagi added the kind/feature New feature or request label Feb 16, 2024
Copy link
Contributor

Hello misogihagi 👋 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

@yuxiang-zhang yuxiang-zhang changed the title [Feature] Make error messages easy to understand [Feature] Check support of subnets for instanceTypes Feb 28, 2024
Copy link
Contributor

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 github-actions bot added the stale label Mar 29, 2024
@misogihagi
Copy link
Author

( º︵º )

@github-actions github-actions bot removed the stale label Apr 1, 2024
@TiberiuGC
Copy link
Collaborator

TiberiuGC commented Apr 8, 2024

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?

Copy link
Contributor

github-actions bot commented May 9, 2024

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 github-actions bot added the stale label May 9, 2024
@misogihagi
Copy link
Author

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.

@github-actions github-actions bot removed the stale label May 11, 2024
@TiberiuGC
Copy link
Collaborator

Related to #7064

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants