Kubernetes on EKS (Elastic Kubernetes Service)
OPTION 1: Using eksctl (Recommended for Beginners)
Prerequisites
- AWS CLI configured (
aws configure) eksctlinstalled → https://eksctl.iokubectlinstalled → Kubernetes CLI
Step-by-Step
🔹 Step 1: Install eksctl (if not already)
🔹 Step 2: Create an EKS Cluster
eksctl create cluster \
--name my-cluster \
--region us-east-2 \
--nodegroup-name linux-nodes \
--node-type t3.medium \
--nodes 2 \
--nodes-min 1 \
--nodes-max 3 \
--managed
With autoscaling:
eksctl create cluster \
--name my-cluster --version 1.33 \
--region us-east-2 --nodegroup-name my-workers \
--node-type t3.medium --nodes 2 --nodes-min 1 --nodes-max 3 \
--managed --asg-access
It automatically sets up:
- EKS control plane
- EC2 worker nodes (managed node group)
- VPC, subnets, IAM roles
- Auth for
kubectl
Step 3: Verify the Cluster
kubectl get nodes
kubectl get svc
You should see your nodes in Ready status.
OPTION 2: Using AWS Console (UI)
Best for those who prefer GUI
-
Go to AWS Console → EKS → “Create cluster”
-
Configure:
- Cluster name
- Kubernetes version
- Role (create one if needed)
- VPC/Subnet settings
-
Create a Node Group (managed)
-
Connect using
aws eks update-kubeconfigcommand tokubectl
OPTION 3: Using Terraform (Infrastructure as Code)
Create EKS using Terraform (more complex, good for production/CI/CD).
What Gets Created?
-
EKS Control Plane
- Managed By: AWS (serverless)
-
EC2 Nodes
- Managed By: Your AWS account
-
VPC, subnets
- Managed By: Default or custom
-
IAM roles & policies
- Managed By: Needed for EKS and nodes
-
kubectl access config
- Managed By: Mapped in
aws-authConfigMap
- Managed By: Mapped in
IAM Permissions Required
You (or your CLI user) should have:
eks:*ec2:*iam:*cloudformation:*autoscaling:*
Or use the pre-built AdministratorAccess policy.
Cleanup
eksctl delete cluster --name my-cluster --region us-east-2