Create an Amazon EKS Cluster
20 Dec 2023 in TIL
I've been using this Terraform module to deploy test EKS clusters for the longest time, but I just learned that it's even easier when using eksctl
.
Create a cluster.yaml
file with the following contents. You can change the instanceType
and desiredCapacity
(the number of nodes) if needed:
yaml
apiVersion: eksctl.io/v1alpha5kind: ClusterConfigmetadata:name: mheap-testingregion: eu-west-2nodeGroups:- name: ng-1instanceType: m5.largedesiredCapacity: 1volumeSize: 80ssh:allow: false
Run eksctl create cluster
. It takes around 4 minutes:
bash
eksctl create cluster -f cluster.yaml
Update your kubeconfig
using the aws
CLI:
bash
aws eks --region eu-west-2 update-kubeconfig --name mheap-testing
Now you can run all the kubectl
commands that you want.
To delete the cluster when you're done:
bash
eksctl delete cluster -f cluster.yaml