Andrew Mercer
on this page
  • https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html
  • https://eksctl.io

eksctl is the quickest route. It builds the VPC, IAM roles, control plane, and node group through CloudFormation in a single command.

Prerequisites

  • AWS CLI v2, authenticated (aws sts get-caller-identity)
  • eksctl

Variables

CLUSTER=eks-lab
REGION=ca-central-1

Create the cluster

eksctl create cluster \
  --name $CLUSTER \
  --region $REGION \
  --nodegroup-name ng-default \
  --node-type t3.medium \
  --nodes 2 \
  --nodes-min 1 \
  --nodes-max 3 \
  --managed

Creation takes about 15–20 minutes. Add --version <x.y> to pin the Kubernetes version.

For anything you'll recreate more than once, put the settings in a ClusterConfig file and run eksctl create cluster -f cluster.yaml.

Connect

eksctl writes the kubeconfig entry automatically. To add it on another machine:

aws eks update-kubeconfig --region $REGION --name $CLUSTER
kubectl get nodes

Clean up

eksctl delete cluster --name $CLUSTER --region $REGION

Delete any LoadBalancer services first. Otherwise the ELBs they created can block VPC deletion.