Skip to content

mo-jasim/Jerney-k8s-Blog-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jerney - Kubernetes DevOps Project

Jerney is a 3-tier blog application deployed on Kubernetes.

It has:

  • Frontend: React app served by Nginx
  • Backend: Node.js + Express API
  • Database: PostgreSQL

This project shows how I built and deployed the full stack on Amazon EKS, while managing cloud infrastructure with Terraform.

Project Goal

The main goal of this project is to show practical DevOps skills:

  • Containerizing each service
  • Running multi-service workloads on Kubernetes
  • Managing secrets and config properly
  • Using persistent storage for database data
  • Building cloud infrastructure as code (Terraform)
  • Deploying the application on EKS

High-Level Architecture

Client -> Frontend Service (Nginx/React) -> Backend Service (Express API) -> DB Service (PostgreSQL)

Inside Kubernetes:

  • All workloads run in the jerney namespace
  • Each tier has its own Deployment and Service
  • Backend and DB use internal ClusterIP networking
  • Frontend is exposed through a NodePort

Services and Responsibilities

1) Frontend Service

Resource:

  • Service name: jerney-deployment
  • Type: NodePort
  • Port: 80 (NodePort 30000)

Responsibility:

  • Serves the React UI to users
  • Proxies all /api/* requests to the backend service
  • Acts as the entry point to the application

How it works:

  • User opens the frontend URL
  • Nginx serves static UI files
  • For API calls, Nginx forwards traffic to jerney-backend:5000

2) Backend Service

Resource:

  • Service name: jerney-backend
  • Type: internal ClusterIP
  • Port: 5000

Responsibility:

  • Handles all blog APIs (posts and comments)
  • Validates requests and runs business logic
  • Connects to PostgreSQL using environment variables from ConfigMap/Secret

How it works:

  • Receives API requests from frontend
  • Reads/writes post and comment data in database
  • Returns JSON responses to frontend

3) Database Service

Resource:

  • Service name: db
  • Type: internal ClusterIP
  • Port: 5432

Responsibility:

  • Stores application data (posts, comments)
  • Provides persistent storage through PVC

How it works:

  • Only backend connects to it
  • PostgreSQL data is mounted on persistent volume
  • Data survives pod restarts

Kubernetes Infrastructure Components

Namespace

  • jerney namespace isolates all project resources.

Deployments

  • jerney-deployment: runs frontend container
  • backend-deployment: runs backend container
  • postgres-deployment: runs PostgreSQL container

Config and Secrets

  • ConfigMap (jerney-configmap) stores non-sensitive values like ports
  • Secret (jerney-secrets) stores DB credentials and DB connection settings

Storage

  • PersistentVolume (jerney-pv)
  • PersistentVolumeClaim (jerney-pvc)

These keep database data safe beyond pod lifecycle.

Service Communication Flow

  1. User accesses frontend through NodePort.
  2. Frontend serves UI and sends API calls to /api.
  3. Nginx in frontend forwards /api traffic to backend service (jerney-backend).
  4. Backend processes request and queries database via db service.
  5. Database returns data to backend.
  6. Backend sends response to frontend.
  7. Frontend shows result to user.

How I Built This Project

  1. Built frontend and backend as separate Docker images.
  2. Kept PostgreSQL as a dedicated data tier.
  3. Defined Kubernetes resources for namespace, deployments, services, secrets, configmap, and storage.
  4. Connected services using Kubernetes DNS names (jerney-backend, db).
  5. Added persistent volume claim for database durability.
  6. Added local kind setup for local Kubernetes testing.
  7. Used Terraform to provision AWS networking and EKS cluster.
  8. Applied Kubernetes manifests to run the app on EKS.

Terraform-Managed AWS Infrastructure

Terraform code creates:

  • VPC with public and private subnets
  • NAT gateway for private subnet egress
  • EKS cluster (Auto Mode)
  • Cluster logging and encryption settings
  • Required subnet tags for Kubernetes load balancing

This gives a repeatable and version-controlled cloud setup.

Deployment Steps (EKS)

1) Provision Infrastructure

From terraform/:

terraform init
terraform plan
terraform apply

2) Configure kubectl

aws eks update-kubeconfig --region ap-south-1 --name jerney-eks

3) Deploy Kubernetes Resources

From project root:

kubectl apply -f k8s/namespace.yml
kubectl apply -f k8s/secrets.yml
kubectl apply -f k8s/configmap.yml
kubectl apply -f k8s/pv.yml
kubectl apply -f k8s/pvc.yml
kubectl apply -f k8s/postgres-deployment.yml
kubectl apply -f k8s/backend-deployment.yml
kubectl apply -f k8s/frontend-deployment.yml
kubectl apply -f k8s/services.yml

4) Verify

kubectl get pods -n jerney
kubectl get svc -n jerney
kubectl get pvc -n jerney

Key DevOps Highlights for Recruiters

  • End-to-end 3-tier architecture deployment on Kubernetes
  • Infrastructure as Code with Terraform for AWS + EKS
  • Clear service boundaries and internal service communication
  • Secure config handling with Secrets and ConfigMaps
  • Persistent storage setup for database reliability
  • Containerized workloads with clean separation of concerns

Notes

  • Current Kubernetes manifests expose frontend using NodePort.
  • For production internet exposure, an Ingress or LoadBalancer service is recommended.
  • Image names in manifests currently use local tags (latest); for shared environments, use a registry (for example, ECR).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors