Creating an EKS cluster via eksctl
To create a new Kubernetes cluster on AWS (EKS), we must first create a user with the necessary permissions.
Prerequisites
- AWS account with appropriate permissions
- AWS CLI installed and configured
- eksctl installed
- kubectl installed
Step 1: Install eksctl
<h1 id="heading-3">macOS</h1>
brew install eksctl
<h1 id="heading-4">Linux</h1> curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp sudo mv /tmp/eksctl /usr/local/bin
Step 2: Create IAM User with Required Permissions
Create an IAM user with the following policies:
- AmazonEKSClusterPolicy
- AmazonEKSServicePolicy
- AmazonEKSVPCResourceController
Step 3: Create EKS Cluster
eksctl create cluster \
--name my-cluster \ --region us-east-1 \ --nodegroup-name standard-workers \ --node-type t3.medium \ --nodes 3 \ --nodes-min 1 \ --nodes-max 4 \ --managed
Step 4: Verify Cluster Creation
eksctl get cluster
kubectl get nodes
Step 5: Configure kubectl
aws eks update-kubeconfig --name my-cluster --region us-east-1
Your EKS cluster is now ready to use!
