Skip to content

Aamir017/CI-CD-Pipeline-for-Log-Monitoring

Repository files navigation

🚀 CI/CD Pipeline with Jenkins, Docker, and Kubernetes

📌 Project Overview

This project demonstrates a full DevOps workflow by building, containerizing, and deploying a Node.js application using:

  • Jenkins for CI/CD automation
  • Docker for containerization
  • Kubernetes for orchestration
  • AWS EC2 as the hosting environment

The pipeline automates:

  1. Code build & test
  2. Docker image creation
  3. Pushing the image to Docker Hub
  4. Deploying the app to Kubernetes (currently manual, can be automated later)

🛠 Tech Stack

  • Backend: Node.js + Express
  • CI/CD: Jenkins
  • Containerization: Docker
  • Orchestration: Kubernetes (kubectl / k3s / minikube)
  • Hosting: AWS EC2 (Ubuntu)
  • Registry: Docker Hub

📂 Project Structure

├── ansible/               # Ansible playbooks (infra automation)
├── k8s/                   # Kubernetes manifests
│   ├── deployment.yaml
│   ├── service.yaml
│   └── ingress.yaml       # Added ingress config
├── public/                # Static assets for Node.js app
├── terraform/             # Terraform IaC files
├── .dockerignore
├── .gitattributes
├── .gitignore
├── Dockerfile              # Docker build instructions
├── Jenkinsfile             # CI/CD pipeline definition
├── package-lock.json
├── package.json
├── server.js               # Node.js server

⚙️ Pipeline Workflow

  • Developer pushes code to GitHub

  • Jenkins pulls the code via webhook

  • Jenkins builds the Docker image and tags it

  • Docker image is pushed to Docker Hub

  • (Manual step) Run kubectl apply -f k8s/ to deploy to Kubernetes cluster


📋 Prerequisites

  • Before running this project, ensure you have:

  • AWS EC2 instance (Ubuntu)

  • Docker installed

  • Jenkins installed and configured

  • Kubernetes cluster (minikube, k3s, or full cluster)

  • Docker Hub account


🚀 Setup & Installation

1️⃣ Clone Repository

git clone https://github.com/Aamir017/CI-CD-Pipeline-for-Log-Monitoring.git
cd CI-CD-Pipeline-for-Log-Monitoring

2️⃣ Build & Run Locally

docker build -t log-monitor .
docker run -p 3000:3000 log-monitor

Open http://localhost:3000 in your browser.

3️⃣ Jenkins Setup

  • Install required Jenkins plugins:

    • Docker Pipeline

    • Git

    • Kubernetes CLI

  • Create a new Pipeline job and link it to your GitHub repo

  • Add your Docker Hub credentials in Jenkins


☸ Kubernetes Deployment

Create Deployment

kubectl apply -f k8s/deployment.yaml

Create Service

kubectl apply -f k8s/service.yaml

Check Pods

kubectl get pods

Screenshots

Screenshot 2025-08-10 185826 Screenshot 2025-08-08 153633 Screenshot 2025-08-08 153633

👤 Author Sk. Aamir Ahmed

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published