Skip to content

Issue Tracker – A fully automated 3-tier web application (React + Node.js + MongoDB) deployed on AWS EKS with GitHub Actions CI/CD and Amazon ECR. This project demonstrates enterprise-grade DevOps practices including containerization, Kubernetes manifests, rolling updates, IAM OIDC roles, and end-to-end cloud deployment automation.

License

Notifications You must be signed in to change notification settings

nipun221/issue-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Issue Tracker — Full CI/CD on AWS (ECR + EKS)

React + Node.js + MongoDB | GitHub Actions| Docker | ECR | Kubernetes

🎬 Video Walkthrough (YouTube): https://youtu.be/V_LmJB9ZXu0

This project is a 3-tier cloud-native Issue Tracker application deployed using a fully automated CI/CD pipeline. Every push to main triggers GitHub Actions, which:

  1. Builds Docker images for the frontend and backend
  2. Pushes them to Amazon ECR
  3. Deploys them to Amazon EKS
  4. Updates the running application with zero downtime

This repository is excellent for learning real-world DevOps pipelines and modern Kubernetes deployments.


🏗️ Architecture

               ┌──────────────────┐
               │   GitHub Repo     │
               └─────────┬────────┘
                         │ Push (main)
                         ▼
                 ┌──────────────────┐
                 │ GitHub Actions CI │
                 └───────┬──────────┘
       Builds & Pushes    │
    Docker Images → ECR    ▼
         ┌──────────────────────────────┐
         │  AWS Elastic Container Reg.  │
         └──────────────┬──────────────┘
                        ▼
                ┌──────────────────┐
                │     AWS EKS       │
                └──────────────────┘
              (Frontend | Backend | Mongo)

Professional Project Diagram: Mermaid

flowchart LR
    A[Developer Push to main] --> B[GitHub Actions]

    subgraph CI/CD Pipeline
        B --> C[Build Docker Images]
        C --> D[Push to Amazon ECR]
        D --> E[Update kubeconfig]
        E --> F[Deploy to EKS via kubectl]
    end

    subgraph AWS EKS Cluster
        F --> G[Frontend Deployment\n(React + NGINX)]
        F --> H[Backend Deployment\n(Node.js + Express)]
        F --> I[MongoDB Deployment]
        
        H --> I
        G --> H
    end

    G --> J[(LoadBalancer Service)]
    J --> K[End User Browser]

Features

🔹 Application

  • Frontend: React + Vite
  • Backend: Node.js + Express
  • Database: MongoDB
  • Clean UI for Issue creation + listing

🔹 DevOps / Cloud

  • Fully containerized with Docker
  • Kubernetes deployments for ALL services
  • MongoDB deployed directly in cluster
  • CI/CD using GitHub Actions
  • ECR as image registry
  • EKS (managed Kubernetes) for hosting
  • Automatic application rollout on every push
  • Namespaces + services + deployments

📂 Repository Structure

.
├── frontend/                 # React app
├── backend/                  # Express API
├── k8s/
│   ├── namespace.yml
│   ├── mongo-deployment.yml
│   ├── backend-deployment.yml
│   ├── frontend-deployment.yml
├── .github/workflows/
│   └── deploy.yml           # GitHub Actions CI/CD pipeline
└── README.md

⚙️ CI/CD Pipeline (GitHub Actions)

✔️ Trigger

Pipeline runs on every push to main:

on:
  push:
    branches: [ "main" ]

✔️ Major Steps

  1. Checkout repo
  2. Assume AWS IAM Role using OIDC
  3. Login to ECR
  4. Build & push Docker images
  5. Update kubeconfig for EKS
  6. Apply K8s manifests
  7. Update Deployment images using set image
  8. Wait for rollout

This guarantees zero-downtime deployment.


🐳 Dockerization

Both apps include lightweight production Dockerfiles:

Backend Dockerfile (Node.js)

FROM node:18-alpine
WORKDIR /app
COPY package*.json .
RUN npm install --production
COPY . .
EXPOSE 4000
CMD ["node", "src/server.js"]

Frontend Dockerfile (React + Vite)

FROM node:18-alpine AS builder
WORKDIR /app
COPY . .
RUN npm install && npm run build

FROM nginx:alpine
# Copy custom nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy built frontend
COPY --from=builder /app/dist /usr/share/nginx/html

EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

⚙️ AWS & Kubernetes Setup

Follow these steps exactly, in order.


1️⃣ Create ECR Repositories

From your local machine (with AWS CLI configured):

aws ecr create-repository \
  --repository-name issue-tracker-frontend \
  --region ap-south-1

aws ecr create-repository \
  --repository-name issue-tracker-backend \
  --region ap-south-1

2️⃣ Install eksctl locally

curl --silent --location "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" \
  | tar xz -C /tmp

sudo mv /tmp/eksctl /usr/local/bin
eksctl version

3️⃣ Create the EKS Cluster

Run from your laptop:

eksctl create cluster \
  --name issue-tracker-cluster \
  --region ap-south-1 \
  --nodegroup-name issue-tracker-nodes \
  --node-type t3.small \
  --nodes 2 \
  --managed

When finished, confirm:

kubectl get nodes

4️⃣ Create IAM Role for GitHub Actions (MANDATORY)

Step 1 → Add GitHub OIDC Provider

In AWS IAM → Identity providers → Add provider

  • Provider: GitHub
  • Audience: sts.amazonaws.com

Step 2 → Create IAM Role GitHubActionsEKSRole

Use “Web Identity” with the GitHub provider above.

Step 3 → Trust Policy

Replace your-org and your-repo:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Federated": "arn:aws:iam::<ACCOUNT_ID>:oidc-provider/token.actions.githubusercontent.com"
      },
      "Action": "sts:AssumeRoleWithWebIdentity",
      "Condition": {
        "StringEquals": {
          "token.actions.githubusercontent.com:aud": "sts.amazonaws.com",
          "token.actions.githubusercontent.com:sub": "repo:nipun221/issue-tracker:ref:refs/heads/main"
        }
      }
    }
  ]
}

Step 4 → Attach Permissions Policy

Attach:

  • AmazonEC2ContainerRegistryFullAccess
  • AmazonEKSClusterPolicy
  • AmazonEKSWorkerNodePolicy
  • AmazonEKS_CNI_Policy
  • IAMReadOnlyAccess
  • Custom inline allowing:
{
  "Effect": "Allow",
  "Action": [
    "eks:DescribeCluster",
    "eks:DescribeNodegroup",
    "eks:ListClusters"
  ],
  "Resource": "*"
}

5️⃣ Add Role to EKS (VERY IMPORTANT)

kubectl edit configmap aws-auth -n kube-system

Paste under mapRoles::

- rolearn: arn:aws:iam::<ACCOUNT_ID>:role/GitHubActionsEKSRole
  username: github-actions
  groups:
    - system:masters

This gives your GitHub workflow cluster admin for deployment.


6️⃣ GitHub Actions Variables

Add these in Repository → Settings → Variables:

AWS_REGION = ap-south-1
AWS_ACCOUNT_ID = 15882564789
EKS_CLUSTER_NAME = issue-tracker-cluster

7️⃣ Deploy via GitHub Actions

Push to main:

git add .
git commit -m "trigger deployment"
git push

GitHub Actions will:

  • build images
  • push to ECR
  • update EKS manifests
  • rollout updates

☸️ Kubernetes Deployment (Updated)

MongoDB

Your demo database uses emptyDir: (ephemeral). Data resets when the Mongo pod is replaced.

Backend

Connects via DNS:

mongodb://mongo:27017/issue_tracker

Frontend

Served via LoadBalancer Backend API resolved via cluster DNS.


🧪 Testing the Deployed App

Get the frontend URL:

kubectl get svc -n issue-tracker

Open in browser → create issues → watch app work end-to-end.


📸 Screenshots

  • EKS node view: Screenshot 2025-11-30 at 09-56-56 Elastic Kubernetes Service ap-south-1

  • GitHub Actions workflow success: Screenshot 2025-11-30 at 09-54-10 title update in App jsx · nipun221_issue-tracker@48a3837

  • UI screenshot after deployment: Screenshot 2025-11-30 at 17-30-54 Issue Tracker

  • ECR repo: Screenshot 2025-11-30 at 09-54-24 Elastic Container Registry - Private repositories

  • ECR repo backend: Screenshot 2025-11-30 at 09-54-36 Elastic Container Registry - Private repository

  • ECR repo frontend: Screenshot 2025-11-30 at 09-54-49 Elastic Container Registry - Private repository

  • Services info: Screenshot_20251130_095821


🗑 Cleaning Up (To Stop Billing)

Run these in exact order:

1. Delete workloads & namespace

kubectl delete namespace issue-tracker

2. Delete EKS cluster

eksctl delete cluster \
  --name issue-tracker-cluster \
  --region ap-south-1

3. Delete ECR repos

aws ecr delete-repository --repository-name issue-tracker-frontend --force --region ap-south-1
aws ecr delete-repository --repository-name issue-tracker-backend --force --region ap-south-1

4. Delete IAM role

Manually delete GitHubActionsEKSRole in AWS console.

5. Do NOT delete Default VPC

AWS recreates it automatically → leave it.


🎯 What You’ll Learn From This Project

  1. GitHub Actions CI/CD
  2. AWS IAM Roles (OIDC)
  3. Pushing Docker images to ECR
  4. Deploying microservices to Kubernetes
  5. Managing multi-tier applications in EKS
  6. DNS-based service discovery
  7. Infrastructure as Code (EKSctl)

If this project helped you, star the repo!

This motivates me to create more DevOps projects and tutorials.


About

Issue Tracker – A fully automated 3-tier web application (React + Node.js + MongoDB) deployed on AWS EKS with GitHub Actions CI/CD and Amazon ECR. This project demonstrates enterprise-grade DevOps practices including containerization, Kubernetes manifests, rolling updates, IAM OIDC roles, and end-to-end cloud deployment automation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published