Skip to content

Repository files navigation

🚀 Capstone Project 2 — End-to-End DevOps Lifecycle Automation

A fully automated, production-style software delivery pipeline — from a single git push to a live application running on Kubernetes.

🔴 Before (initial deploy) 🟢 After (auto-redeployed via pipeline)

Proof the pipeline works end-to-end: a code change pushed to GitHub was automatically built, pushed to Docker Hub, and rolled out to Kubernetes — no manual deployment steps.


📖 Table of Contents


📌 Project Overview

This project demonstrates the implementation of a complete DevOps lifecycle using industry-standard tools and practices. The objective was to automate the entire software delivery process — starting from infrastructure provisioning to application deployment on Kubernetes — using CI/CD pipelines.

The project follows a real-world production workflow where:

  • Infrastructure is provisioned automatically
  • Servers are configured using automation tools
  • Applications are containerized
  • Deployments are managed through Kubernetes orchestration

The entire pipeline is integrated with GitHub and Jenkins to achieve Continuous Integration and Continuous Deployment (CI/CD).


🎯 Project Objective

# Objective
1 Provision cloud infrastructure automatically
2 Configure servers without manual intervention
3 Build and deploy Docker containers automatically
4 Implement CI/CD using Jenkins
5 Manage application deployments using Kubernetes
6 Automate software delivery from GitHub push to production deployment

🏗️ Architecture Overview

Developer
    │
    ▼
GitHub Repository
    │
    ▼
GitHub Webhook Trigger
    │
    ▼
Jenkins Pipeline
    │
    ├── Source Code Checkout
    ├── Docker Image Build
    ├── Docker Image Push
    └── Kubernetes Deployment Update
    │
    ▼
Docker Hub Registry
    │
    ▼
Kubernetes Cluster
    │
    ├── Master Node
    ├── Worker Node 1
    └── Worker Node 2
    │
    ▼
NodePort Service
    │
    ▼
End Users Access Application

🛠️ Technology Stack

Category Tools
Cloud Provider AWS
Infrastructure as Code Terraform
Configuration Management Ansible
CI/CD Jenkins
Containerization Docker, Docker Hub
Orchestration Kubernetes
Version Control Git & GitHub
Web Server Nginx

☁️ Infrastructure Provisioning using Terraform

EC2 Instances Provisioned:

Instance Name Role
worker1-jenkins Jenkins Server
worker2-k8s Kubernetes Worker Node
worker3-master Kubernetes Master Node
worker4-k8s Kubernetes Worker Node

Total EC2 Instances: 4


⚙️ Configuration Management using Ansible

Automated tasks handled by Ansible playbooks:

  • ✅ Java installation
  • ✅ Jenkins installation
  • ✅ Docker installation
  • ✅ Kubernetes installation
  • ✅ Cluster configuration

🔄 Jenkins CI/CD Pipeline

Pipeline Stages:

  1. 🔽 Source Code Checkout
  2. 🐳 Docker Image Build
  3. 📤 Docker Image Push
  4. ☸️ Kubernetes Deployment
  5. ✅ Deployment Verification

🐳 Docker Implementation

  • Repository: anshu9103/capstone-website
  • Image Tagging Strategy: anshu9103/capstone-website:${BUILD_NUMBER}

☸️ Kubernetes Implementation

Component Detail
Master Nodes 1
Worker Nodes 2
Application Replicas 2
Service Type NodePort
Exposed Port 30008

✅ Validation Performed

  • Terraform infrastructure provisioning
  • Ansible automation
  • Jenkins pipeline execution
  • Docker image build and push
  • Kubernetes deployment rollout
  • Application accessibility through NodePort — see before/after screenshots above
  • GitHub webhook trigger

🧩 Challenges and Solutions

❌ Jenkins Failed to Start
  • Cause: Java 17 installed while Jenkins required Java 21.
  • Fix: Installed OpenJDK 21.
❌ Docker Push Failed
  • Cause: Jenkins user not authenticated to Docker Hub.
  • Fix: Performed Docker login as Jenkins user.
❌ ImagePullBackOff
  • Cause: ARM image compatibility issues.
  • Fix: Rebuilt and pushed compatible images.
❌ GitHub Push Failed
  • Cause: .terraform files exceeded GitHub size limits.
  • Fix: Added .terraform and state files to .gitignore.
❌ Kubernetes API Connection Refused
  • Cause: Control plane services restarting during initialization.
  • Fix: Verified and stabilized control plane components.
❌ Calico CrashLoopBackOff
  • Cause: Containerd cgroup mismatch.
  • Fix: Enabled SystemdCgroup=true.

📁 Repository Structure

capstone-project-2-devops-lifecycle/
│
├── terraform/
├── ansible/
├── docker/
├── kubernetes/
├── Jenkinsfile
├── README.md
└── capstone-project-2.pdf

🏁 Final Result

Stage Status
Infrastructure Provisioned with Terraform
Configuration Managed with Ansible
CI/CD Automated with Jenkins
Application Containerized with Docker
Application Orchestrated with Kubernetes
Production Deployment Successfully Completed

🚀 End-to-End DevOps Lifecycle Successfully Implemented 🚀

About

AWS Kubernetes capstone using Jenkins, Amazon ECR and a kubeadm cluster with one control plane, two workers and automated container deployment.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages