E-Commerce Three-Tier App on EKS with Helm
test -f README.mdOverview
Section titled “Overview”README-focused EKS/Helm architecture walkthrough.
What You Will Build
Section titled “What You Will Build”Architecture Diagram
Section titled “Architecture Diagram”Prerequisites
Section titled “Prerequisites”- Install or review: EKS, Helm, Three Tier App, AWS.
- Use your own cloud account credentials and keep them out of commits.
- This project expects cloud resources, so verify budget alerts and cleanup first.
- Open the safety guide before running commands that create infrastructure.
Credentials And Cost Warning
Section titled “Credentials And Cost Warning”Cost risk is high. Cloud target: AWS. Cloud credentials needed: Yes. Always use your own account, never commit secrets, and confirm cleanup before creating paid infrastructure.
Step-By-Step Lab
Section titled “Step-By-Step Lab”Use this flow before you run commands:
- Read the cost and credential warning above.
- Review the validation, troubleshooting, cleanup, and portfolio proof sections below.
- Follow the original project guide preserved near the bottom of this page.
- Return to the validation and cleanup checks before you capture portfolio evidence.
Validation Checks
Section titled “Validation Checks”Run the project validation command before and after meaningful changes:
test -f README.mdTroubleshooting
Section titled “Troubleshooting”- Run
test -f README.mdfirst so local tooling issues are visible early. - If a command fails, check tool versions, working directory, and required environment variables.
- For cloud failures, confirm account identity, region, quotas, and least-privilege IAM.
Cleanup
Section titled “Cleanup”No dedicated cleanup command was detected in the project README. Treat this as a warning: before provisioning anything, write down the exact delete, destroy, or rollback steps for your environment.
Portfolio Proof
Section titled “Portfolio Proof”- Validation command output:
test -f README.md - Screenshot or terminal proof: Architecture notes plus validation output
- Notes explaining what changed, what failed, and how you fixed it
- Cleanup evidence, especially for cloud or Kubernetes resources
Original Project Guide
Section titled “Original Project Guide”The original README content is preserved here for lab-specific commands and context. Headings are intentionally demoted so the page outline stays focused on the standard lab flow.
Introduction:
Section titled “Introduction:”In the dynamic landscape of software development, architects and developers constantly seek robust design patterns that ensure scalability, maintainability, and efficient resource utilization. One such time-tested approach is the 3-tier architecture, a well-structured model that divides an application into three interconnected layers. This architectural style has been a cornerstone for building scalable and resilient applications for decades.
Understanding the Basics:
The 3-tier architecture is composed of three primary layers, each with distinct responsibilities:
- Presentation Layer:
-
Also known as the user interface layer, this tier is responsible for interacting with end-users.
-
It encompasses the user interface components, such as web pages, mobile apps, or any other interface through which users interact with the application.
-
The goal is to provide a seamless and intuitive user experience while keeping the presentation logic separate from the business logic.
2. Application (or Business Logic) Layer:
-
Positioned between the presentation and data layers, the application layer contains the business logic that processes and manages user requests.
-
It acts as the brain of the application, handling tasks such as data validation, business rules implementation, and decision-making.
-
Separating the business logic from the presentation layer promotes code reusability, maintainability, and adaptability to changes.
3. Data Layer:
-
The data layer is responsible for managing and storing the application’s data.
-
It includes databases, data warehouses, or any other data storage solutions.
-
This layer ensures data integrity, security, and efficient data retrieval for the application.
-
By isolating data-related operations, developers can optimize data access and storage mechanisms independently of the rest of the application.
Benefits of 3-Tier Architecture:
- Scalability:
-
The modular nature of 3-tier architecture allows for independent scaling of each layer.
-
This enables efficient resource allocation, ensuring that specific components can be scaled based on demand without affecting the entire application.
2. Maintainability:
-
With clear separation of concerns, developers can make changes to one layer without impacting others.
-
This facilitates easier debugging, updates, and maintenance, as modifications can be confined to the relevant layer.
3. Flexibility and Adaptability:
-
The architecture accommodates technology changes and updates without disrupting the entire system.
-
New technologies can be integrated into specific layers, allowing the application to evolve over time.
Prerequisites:
Section titled “Prerequisites:”-
kubectl — A command line tool for working with Kubernetes clusters. For more information, see Installing or updating kubectl. https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html
-
eksctl — A command line tool for working with EKS clusters that automates many individual tasks. For more information, see Installing or updating. https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html
-
AWS CLI — A command line tool for working with AWS services, including Amazon EKS. For more information, see Installing, updating, and uninstalling the AWS CLI https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html in the AWS Command Line Interface User Guide.
-
After installing the AWS CLI, I recommend that you also configure it. For more information, see Quick configuration with aws configure in the AWS Command Line Interface User Guide. https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-config
Steps:
Section titled “Steps:”Step-1: Create an EKS Cluster
Section titled “Step-1: Create an EKS Cluster”eksctl create cluster \ --name your-cluster-name \ --region your-region \ --nodegroup-name your-nodegroup-name \ --node-type t3.small \ --nodes 2 \ --nodes-min 1 \ --nodes-max 3This will create an EKS Cluster along with the node-group
Step-2: Configure IAM OIDC provider
Section titled “Step-2: Configure IAM OIDC provider”- Export Cluster Name and assign oidc_id
export cluster_name=<CLUSTER-NAME>oidc_id=$(aws eks describe-cluster --name $cluster_name --query "cluster.identity.oidc.issuer" --output text | cut -d '/' -f 5)2. Check if there is an IAM OIDC provider configured already
aws iam list-open-id-connect-providers | grep $oidc_id | cut -d "/" -f43. If not, run the below command.
eksctl utils associate-iam-oidc-provider --cluster $cluster_name --approveStep-3: Setup ALB Add-On
Section titled “Step-3: Setup ALB Add-On”- Download IAM policy.
curl -O https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.5.4/docs/install/iam_policy.json2. Create IAM Policy.
aws iam create-policy \ --policy-name AWSLoadBalancerControllerIAMPolicy \ --policy-document file://iam_policy.json3. Create IAM Role.
eksctl create iamserviceaccount \ --cluster=<your-cluster-name> \ --namespace=kube-system \ --name=aws-load-balancer-controller \ --role-name AmazonEKSLoadBalancerControllerRole \ --attach-policy-arn=arn:aws:iam::<your-aws-account-id>:policy/AWSLoadBalancerControllerIAMPolicy \ --approveStep-4: Deploy ALB controller
Section titled “Step-4: Deploy ALB controller”- Add helm repo.
helm repo add eks https://aws.github.io/eks-charts2. Update the repo.
helm repo update eks3. Install the chart.
helm install aws-load-balancer-controller eks/aws-load-balancer-controller -n kube-system --set clusterName=<your-cluster-name> \--set serviceAccount.create=false --set serviceAccount.name=aws-load-balancer-controller --set region=<region> --set vpcId=<your-vpc-id>4. Verify that the deployments are running.
kubectl get deployment -n kube-system aws-load-balancer-controllerStep-5: EBS CSI Plugin configuration.
Section titled “Step-5: EBS CSI Plugin configuration.”-
The Amazon EBS CSI plugin requires IAM permissions to make calls to AWS APIs on your behalf.
-
Create an IAM role and attach a policy. AWS maintains an AWS managed policy or you can create your own custom policy. You can create an IAM role and attach the AWS managed policy with the following command. Replace my-cluster with the name of your cluster. The command deploys an AWS CloudFormation stack that creates an IAM role and attaches the IAM policy to it.
eksctl create iamserviceaccount \ --name ebs-csi-controller-sa \ --namespace kube-system \ --cluster <YOUR-CLUSTER-NAME> \ --role-name AmazonEKS_EBS_CSI_DriverRole \ --role-only \ --attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy \ --approve3. Run the following command. Replace with the name of your cluster, with your account ID.
eksctl create addon --name aws-ebs-csi-driver --cluster <YOUR-CLUSTER-NAME> --service-account-role-arn arn:aws:iam::<AWS-ACCOUNT-ID>:role/AmazonEKS_EBS_CSI_DriverRole --forceStep-6: Install the Helm Chart:
Section titled “Step-6: Install the Helm Chart:”- Initially Clone the GitHub Repo:
- GitHub URL : RobotShop-Project
git clone https://github.com/uniquesreedhar/RobotShop-Project.git2. Then Navigate to the path where chart.yaml exists
cd RobotShop-Project/EKS/helm3. Create a namespace and then install the helm chart.
kubectl create ns robot-shophelm install robot-shop --namespace robot-shop .4. Ensure all the pods are running if not troubleshoot the issues.
Step 7: Create Ingress
Section titled “Step 7: Create Ingress”cd /RobotShop-Project/EKS/helm kubectl apply -f ingress.yamlThis will create a Load Balancer on the AWS console.
Paste the DNS-name on your favourite browser and access the application.
Get Register and login into the application.
Rate the Artificial Intelligence.
Add to cart the robots.
Checkout them.
Select your Location and then calculate the price and confirm the order.
Then place the Order.
And pay the amount .
Congratulations… Your Order has been Successfully placed.. :)
Thank you
Section titled “Thank you”Thank you for taking the time to work on this tutorial/labs. Let me know what you thought!
Ensure to follow me on GitHub. Please star/share this repository
Section titled “Ensure to follow me on GitHub. Please star/share this repository”Source Files On GitHub
Section titled “Source Files On GitHub”The full learning flow stays on this page. Open GitHub only when a step asks you to inspect code, fork the lab, or download source assets.