Skip to main content

Deploying a Three-Tier Application on AWS EKS

Published 3 min readMarkdown

Over the past few days, I worked on deploying a three-tier application (Frontend, Backend, Database) on Amazon EKS (Elastic Kubernetes Service). This project gave me hands-on experience with Kubernetes on AWS, containerization, and cloud-native deployment practices.

Here’s how I approached it, step by step:


1) Containerizing the Application

I started by containerizing the frontend and backend using Docker:

  • Built Docker images for both frontend and backend.

  • Pushed the images to Amazon Elastic Container Registry (ECR) for secure storage and easy integration with EKS.

This step made it easy to deploy consistent versions of my application across different environments.


2) Setting Up the EKS Cluster

Next, I created an EKS cluster using AWS CloudFormation:

  • Configured 2 worker nodes (t2.medium) to run my workloads.

  • Set up kubectl context to interact with the cluster seamlessly.


3) Writing Kubernetes Manifests

To deploy each layer of the application, I wrote Kubernetes YAML files:

  • Frontend: deployment.yaml, service.yaml → handles the UI and communicates with the backend.

  • Backend: deployment.yaml, service.yaml → provides API endpoints to the frontend.

  • Database (MongoDB): deployment.yaml, pv.yaml, pvc.yaml, secrets.yaml, service.yaml → ensures persistence, secure credentials, and stable connectivity.

Key Points:

  • PersistentVolume (PV) & PersistentVolumeClaim (PVC): Ensures that MongoDB data persists even if the pod restarts.

  • Secrets: Securely store sensitive data like database credentials.

  • Rolling Update Strategy: Configured in Deployments to update pods gradually without downtime (Kubernetes Docs).

Challenge: If the MongoDB container wasn’t up and running, the backend wouldn’t be able to connect. This taught me the importance of proper service dependencies and readiness probes (Docs).

For reference:


4) Ingress & Load Balancing

  • Installed AWS ALB Ingress Controller using Helm charts.

  • Configured an AWS Application Load Balancer (ALB) for external access.

Since I didn’t have a custom domain, I used the ALB endpoint URL to access the application. In a real-world scenario, I would integrate Route 53 for DNS-based access.


What I Learned & Achieved

  • Docker & ECR for container management

  • Kubernetes Deployments, Services, PVCs, Secrets

  • EKS cluster setup with CloudFormation

  • Helm charts for ALB Ingress Controller

  • Real-world three-tier architecture deployment

This project was not only about deploying an application but also understanding how all the pieces of cloud-native architecture fit together. The experience taught me about pod dependencies, persistence, secrets management, and rolling updates, which are critical in production-grade systems.

Check out the full project and all Kubernetes files here:
https://github.com/skyshourya/kubernetes-3-tier-application-deployment-/tree/main?utm_source=chatgpt.com

I plan to extend this project further by adding monitoring, CI/CD pipelines, and domain-based routing with Route 53.

Thanks for reading, and I hope this inspires others who are learning Kubernetes, AWS, and cloud-native deployments!

Too JAZZ OF ALL…

No comments yet. Be the first to comment.