EKS cluster using an existing VPC

  1. Home
  2. Blog
  3. EKS cluster using an existing VPC

EKS cluster using an existing VPC

The eksctl command line tool can create a cluster by either command-line options or using a eksctl config file to define the infrastructure. The default method to provision EKS with this tool is to create both the VPC and EKS that uses VPC, but this is not as flexible. But what if you already created VPC for your network, below is one of the way to use it. While creating cluster supply your VPC mapping.

eksctl create cluster --profile "${AWS_ACCOUNT}" --config-file -
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: test-cluster
  region: us-west-1
  version: "1.20"

vpc:
  subnets:
    private:
      us-east-2a: { id: subnet-01234abcdef123 }
      us-east-2b: { id: subnet-01234abcdef124 }
      us-east-2c: { id: subnet-01234abcdef125 }
    public:
      us-east-2a: { id: subnet-567890abcdf123 }
      us-east-2b: { id: subnet-567890abcdf124 }
      us-east-2c: { id: subnet-567890abcdf125 }

managedNodeGroups:
  - name: acme-test-cluster
    minSize: 3
    maxSize: 7
    desiredCapacity: 3
    instanceType: m5.2xlarge
    .......
EOF

Let's Share
Show Buttons
Hide Buttons