Skip to content

Latest commit

Β 

History

History
117 lines (93 loc) Β· 2.65 KB

File metadata and controls

117 lines (93 loc) Β· 2.65 KB

DevOps and Cloud Engineer Task

A full-stack application platform deployed on AWS using Docker, Terraform, Kubernetes, and GitHub Actions CI/CD pipeline.


πŸ—οΈ Architecture

  • Frontend β†’ React.js (Dockerized, served via Nginx)
  • Backend β†’ Node.js REST API (Dockerized)
  • Database β†’ PostgreSQL (Kubernetes StatefulSet)
  • Infrastructure β†’ AWS EKS via Terraform
  • CI/CD β†’ GitHub Actions

πŸ› οΈ Tech Stack

Technology Purpose
React.js Frontend UI
Node.js + Express Backend API
PostgreSQL Database
Docker Containerization
Terraform Infrastructure as Code
AWS EKS Kubernetes Cluster
AWS VPC Networking
GitHub Actions CI/CD Pipeline
Kubernetes Container Orchestration

πŸ“ Project Structure

project/
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── deploy.yml       # CI/CD Pipeline
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ package.json
β”‚   └── src/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ package.json
β”‚   └── server.js
β”œβ”€β”€ k8s/
β”‚   β”œβ”€β”€ namespace.yaml
β”‚   β”œβ”€β”€ frontend-deployment.yaml
β”‚   β”œβ”€β”€ backend-deployment.yaml
β”‚   β”œβ”€β”€ postgres-statefulset.yaml
β”‚   β”œβ”€β”€ persistent-volume.yaml
β”‚   └── ingress.yaml
└── terraform/
    β”œβ”€β”€ main.tf
    β”œβ”€β”€ vpc.tf
    β”œβ”€β”€ eks.tf
    β”œβ”€β”€ iam.tf
    └── variables.tf

πŸš€ CI/CD Pipeline

Pipeline runs automatically on every push to main branch:

Push to main
     ↓
Job 1: Build & Push Docker Images
     ↓
Job 2: Terraform Apply (AWS Infrastructure)
     ↓
Job 3: Deploy to Kubernetes

☁️ AWS Infrastructure

  • VPC with 2 public subnets in different AZs
  • EKS Cluster with worker nodes
  • Security Groups for network access
  • IAM Roles for EKS permissions

🐳 Docker

Multi-stage builds for both frontend and backend:

  • Frontend β†’ Node builder + Nginx server
  • Backend β†’ Node.js production image

βš™οΈ Kubernetes

Resource Description
Namespace app-prod
Deployments Frontend + Backend
StatefulSet PostgreSQL
Services ClusterIP for all apps
Ingress NGINX routing
PersistentVolume PostgreSQL storage

πŸ” GitHub Secrets Required

Secret Description
DOCKER_USERNAME Docker Hub username
DOCKER_PASSWORD Docker Hub access token
DOCKER_REGISTRY Docker Hub registry URL
AWS_ACCESS_KEY_ID AWS access key
AWS_SECRET_ACCESS_KEY AWS secret key