Simple Steps to Deploy a Three-Tier E-Commerce System on AWS EKS

Listen to this Post

Featured Image
URL: https://lnkd.in/eyEJMrH7

This article demonstrates a containerized full-stack application deployment on AWS EKS, covering local container testing, pushing images to ECR, and Helm-based deployment.

You Should Know:

1. Building and Testing Containers Locally

Use Docker to build and test containers before pushing them to AWS ECR.

 Build Docker image 
docker build -t ecommerce-app:latest .

Run container locally for testing 
docker run -d -p 8080:80 ecommerce-app:latest

Verify running containers 
docker ps 

2. Pushing Images to AWS ECR

Authenticate Docker with AWS ECR and push your image.

 Login to AWS ECR 
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com

Tag and push the image 
docker tag ecommerce-app:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/ecommerce-app:latest 
docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/ecommerce-app:latest 
  1. Deploying on EKS Using Terraform or eksctl

Option 1: Using eksctl (Quick Setup)

 Create EKS cluster 
eksctl create cluster --name ecommerce-cluster --region us-east-1 --nodegroup-name workers --node-type t3.medium --nodes 3

Update kubeconfig 
aws eks --region us-east-1 update-kubeconfig --name ecommerce-cluster 

Option 2: Using Terraform (Infrastructure as Code)

provider "aws" { 
region = "us-east-1" 
}

module "eks" { 
source = "terraform-aws-modules/eks/aws" 
cluster_name = "ecommerce-cluster" 
cluster_version = "1.27" 
subnets = ["subnet-12345678", "subnet-87654321"] 
vpc_id = "vpc-12345678"

node_groups = { 
eks_nodes = { 
desired_capacity = 3 
max_capacity = 5 
min_capacity = 1 
instance_type = "t3.medium" 
} 
} 
} 

4. Helm Deployment for EKS

Install Helm and deploy the application.

 Install Helm 
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 
chmod 700 get_helm.sh 
./get_helm.sh

Add Helm repo and deploy 
helm repo add bitnami https://charts.bitnami.com/bitnami 
helm install ecommerce-app bitnami/nginx 

5. Verifying Deployment

Check Kubernetes pods and services.

kubectl get pods 
kubectl get svc 

What Undercode Say:

Deploying containerized apps on AWS EKS requires mastering Docker, Kubernetes, and Helm. Automating deployments with Terraform ensures scalability, while eksctl simplifies quick setups. Always test locally before cloud deployment.

Expected Output:

NAME READY STATUS RESTARTS AGE 
ecommerce-app-5f8b6c4d6-2q7xv 1/1 Running 0 2m

NAME TYPE CLUSTER-IP EXTERNAL-IP 
ecommerce-app LoadBalancer 10.100.10.123 a1b2c3d4e5f6.us-east-1.elb.amazonaws.com 

Prediction:

AWS EKS adoption will grow as Kubernetes becomes the standard for cloud-native deployments. Expect tighter integration between ECR, EKS, and CI/CD pipelines for faster DevOps workflows.

IT/Security Reporter URL:

Reported By: Darryl Ruggles – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 Telegram