Skip to content

Repository files navigation

DevOps Portfolio Project

CI/CD Pipeline Tests Security Scan Docker Kubernetes Terraform AWS Prometheus Grafana Node.js License: MIT

A comprehensive DevOps pipeline demonstrating CI/CD automation, container orchestration, infrastructure-as-code, and monitoring — deployed on AWS EKS.

Note: Badges will show live status after the first workflow run on the main branch.

FeaturesArchitectureGetting StartedProject StructureAPIInfrastructureMonitoring


Features

Area Capabilities
CI/CD GitHub Actions with multi-stage pipeline: lint → test → build → security scan → deploy
Containerization Multi-stage Docker builds with security hardening (non-root user, read-only filesystem)
Orchestration Kubernetes with HPA auto-scaling, rolling updates, resource limits, and ingress with TLS
Infrastructure-as-Code Terraform provisioning of VPC, subnets, NAT Gateway, EKS cluster, and node groups
Security Trivy container vulnerability scanning, Pod Security Context, non-root execution
Observability Prometheus metrics collection and Grafana dashboards with custom application metrics
High Availability Multi-AZ deployment, auto-scaling (3–10 pods), health checks with liveness/readiness probes

Architecture

flowchart TB
    subgraph Developer["Developer Workflow"]
        A[Git Push] --> B[GitHub Actions]
    end

    subgraph CI_CD["CI/CD Pipeline"]
        B --> C[Lint & Test]
        C --> D[Docker Build & Push to GHCR]
        D --> E[Trivy Security Scan]
        E --> F[Deploy to Kubernetes]
    end

    subgraph AWS["AWS Cloud (us-east-1)"]
        subgraph VPC["VPC 10.0.0.0/16"]
            direction TB
            IG[Internet Gateway]
            NAT[NAT Gateway]
            
            subgraph Public["Public Subnets (AZ a + b)"]
                ALB[Application Load Balancer]
            end
            
            subgraph Private["Private Subnets (AZ a + b)"]
                EKS[EKS Cluster]
                
                subgraph K8S["Kubernetes"]
                    Pods[Application Pods
                    Replicas: 3-10]
                    HPA[Horizontal Pod
                    Autoscaler]
                end
            end
        end
        
        ECR[ECR Container Registry]
    end

    subgraph Monitoring["Monitoring Stack"]
        Prom[Prometheus
        Scrape Interval: 5s]
        Graf[Grafana
        Dashboards]
    end

    F --> K8S
    D --> ECR
    ECR --> EKS
    IG --> ALB
    ALB --> Pods
    Prom --> Pods
    Graf --> Prom

    style Developer fill:#e1f5fe,stroke:#01579b
    style CI_CD fill:#f3e5f5,stroke:#7b1fa2
    style AWS fill:#fff3e0,stroke:#e65100
    style Monitoring fill:#e8f5e9,stroke:#1b5e20
Loading

Tech Stack

Category Technologies
Application Node.js (v18), Express.js
Containerization Docker, Docker Compose, GitHub Container Registry (GHCR)
Orchestration Kubernetes v1.29, HorizontalPodAutoscaler, Ingress NGINX
Infrastructure Terraform ≥1.3.0, AWS (EKS, VPC, EC2, IAM, S3, DynamoDB)
CI/CD GitHub Actions, Trivy Security Scanner
Monitoring Prometheus, Grafana, prom-client (custom Node.js metrics)
Testing Jest, Supertest, ESLint

Getting Started

Prerequisites

Quick Start

1. Local Development

# Install dependencies and run tests
cd src
npm install
npm test

# Run the application locally
npm start

The API will be available at http://localhost:3000.

2. Docker Compose (Local Stack)

# Start all services (app + Prometheus + Grafana)
docker compose up -d

# Services:
# - App:      http://localhost:3000
# - Grafana:  http://localhost:3030 (admin/admin)
# - Prometheus: http://localhost:9090

# Stop everything
docker compose down

3. Kubernetes Deployment

Note: Update the ingress domain from app.example.com to your real domain in k8s/deployment.yml before deploying to production.

# Deploy to your cluster
make deploy-k8s

# Or manually:
kubectl apply -f k8s/namespace.yml
kubectl apply -f k8s/configmap.yml
kubectl apply -f k8s/deployment.yml

4. Infrastructure Provisioning (AWS EKS)

Prerequisite: Create the S3 bucket devops-portfolio-terraform-state for the Terraform backend before running terraform init.

cd terraform

# Initialize and review
export AWS_REGION=us-east-1
terraform init
terraform plan

# Apply infrastructure
terraform apply -auto-approve

# Configure kubectl
aws eks update-kubeconfig --region us-east-1 --name devops-portfolio-cluster

# Destroy when done
terraform destroy -auto-approve

Project Structure

devops-portfolio-project/
├── .github/
│   └── workflows/
│       └── ci-cd.yml              # CI/CD pipeline (5 stages)
├── k8s/                          # Kubernetes manifests
│   ├── namespace.yml              # Namespaces: production, staging, monitoring
│   ├── configmap.yml              # App ConfigMap + Secrets
│   └── deployment.yml            # Deployment, Service, Ingress, HPA
├── monitoring/                   # Observability stack
│   ├── prometheus.yml              # Prometheus scrape config
│   └── grafana-dashboard.json     # Pre-configured Grafana dashboard
├── terraform/                    # Infrastructure-as-Code
│   ├── main.tf                    # Provider & VPC setup
│   ├── networking.tf              # Subnets, routes, NAT Gateway
│   ├── eks.tf                     # EKS cluster & node group
│   ├── variables.tf              # Configurable variables
│   └── outputs.tf                 # Terraform outputs
├── src/                          # Application source code
│   ├── app.js                    # Express.js API (health, users, metrics)
│   ├── app.test.js               # Jest + Supertest test suite
│   ├── package.json              # Node.js depen

About

A full DevOps pipeline project demonstrating my ability to build, automate, deploy, and monitor cloud-native applications using GitHub Actions, Docker, Kubernetes, Terraform, AWS EKS, Prometheus, and Grafana. Designed as a hands-on practical showcase for DevOps/SRE roles.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages