VpcLimitExceeded

So you’re trying to use eksctl to create an eks cluster but getting the following error “VpcLimitExceeded”.

2021-03-31 10:46:46 [✖] unexpected status “ROLLBACK_COMPLETE” while waiting for CloudFormation stack “eksctl-myeks1-cluster”
2021-03-31 10:46:46 [ℹ] fetching stack events in attempt to troubleshoot the root cause of the failure
2021-03-31 10:46:46 [!] AWS::IAM::Role/ServiceRole: DELETE_IN_PROGRESS
2021-03-31 10:46:46 [!] AWS::EC2::EIP/NATIP: DELETE_IN_PROGRESS
2021-03-31 10:46:46 [✖] AWS::IAM::Role/ServiceRole: CREATE_FAILED – “Resource creation cancelled”
2021-03-31 10:46:46 [✖] AWS::EC2::EIP/NATIP: CREATE_FAILED – “Resource creation cancelled”
2021-03-31 10:46:46 [✖] AWS::EC2::VPC/VPC: CREATE_FAILED – “The maximum number of VPCs has been reached. (Service: AmazonEC2; Status Code: 400; Error Code: VpcLimitExceeded; Request ID: 32089ed3-72de-4246-82f9-3a580cd38bb7; Proxy: null)”
2021-03-31 10:46:46 [✖] AWS::EC2::InternetGateway/InternetGateway: CREATE_FAILED – “The maximum number of internet gateways has been reached. (Service: AmazonEC2; Status Code: 400; Error Code: InternetGatewayLimitExceeded; Request ID: fa054e1c-b439-44f2-9979-2b79a6f3f4f9; Proxy: null)”
2021-03-31 10:46:46 [!] 1 error(s) occurred and cluster hasn’t been created properly, you may wish to check CloudFormation console
2021-03-31 10:46:46 [ℹ] to cleanup resources, run ‘eksctl delete cluster –region=eu-central-1 –name=myeks1’
2021-03-31 10:46:46 [✖] ResourceNotReady: failed waiting for successful resource state

Basically it means that you dont have enough resources to launch the cluster and by resources I mean VPC’s. You have basically reached the limit on the amount of VPC’s you can create in your region. So how do we fix this? Well you can either request a limit increase for VPC creation in your region and wait for it to be approved. This could take some time or just do the following:

Create a yaml file for example mycluster.yaml and create the cluster using this config file instead of flags. This will allow you to use an existing VPC when creating the cluster instead of it trying to provision a new VPC for you.

Here’s an example from https://eksctl.io/:

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
name: cluster-in-existing-vpc
region: eu-central-1

vpc:
subnets:
private:
eu-central-1a: { id: subnet-a45bf2cd }
eu-central-1b: { id: subnet-23945c58 }

nodeGroups:
– name: my-workers
labels: { role: workers }
instanceType: t3.micro
desiredCapacity: 3
privateNetworking: true

However, if you stubborn and want to use flags you can check out the link below:

https://eksctl.io/usage/vpc-networking/

No token or token has expired.

Leave a Reply

Your email address will not be published. Required fields are marked *

My EKS issues

31st Mar 2021