- A machine that will be used as k8s control plane
- Install terraform. See https://learn.hashicorp.com/tutorials/terraform/install-cli.
- Install aws cli. See https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html.
- Configure aws by running
aws configure
and put in correct information - Generate ssh key by running ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa
- Download the files in this repo
- Run
terraform init
- Run
terraform apply -auto-approve
. This step takes around 10-15 minutes. By default the EKS is deployed on 2 r5.2xlarge EC2 instances with k8s version 1.22 - After the cluster is created, run
aws eks update-kubeconfig --region us-east-1 --name <test-eks-xxxxxxxx>
. The name is at the end of the stdout of step 2, in the form oftest-eks-xxxxxxx
- Run
terraform destroy -auto-approve
- Cluster version: modify main.tf line 121
- ec2 instance type: modify main.tf line 136
- Launch on-demand ec2 instances instead of spot instances: comment out main.tf line 138, 139, 140
- Launch different ec2 instance types: add another worker group in the form of main.tf line 134 - 150
Above commands are in ec2-setup.sh