A comprehensive DevOps project demonstrating GitOps workflow with Terraform, Kubernetes, Jenkins CI/CD, ArgoCD, and full monitoring stack on AWS.
- π― Project Overview
- ποΈ Architecture
- π οΈ Tech Stack
- β¨ Key Features
- π Prerequisites
- π Quick Start
- π Detailed Setup Guide
- π Monitoring & Alerts
- π§ Configuration Files
- π Troubleshooting
- π€ Contributing
- π License
This project implements a complete GitOps workflow on AWS with automated infrastructure provisioning, continuous integration/deployment, and comprehensive monitoring. The application is a Python Django web application with MySQL database, deployed on Amazon EKS with persistent storage using EFS.
- Infrastructure as Code with Terraform
- CI/CD Pipeline automation with Jenkins
- GitOps Workflow using ArgoCD
- Kubernetes deployment and management
- Monitoring with Prometheus and Grafana
- AWS Services integration (EKS, ECR, EFS, ALB, ACM, Route53)
graph TB
subgraph "Source Control"
A[GitHub Repository] --> B[Application Code]
A --> C[GitOps Repository]
end
subgraph "CI/CD Pipeline"
B --> D[Jenkins Server]
D --> E[Build Docker Image]
E --> F[Push to ECR]
F --> G[Update GitOps Repo]
end
subgraph "GitOps Deployment"
G --> H[ArgoCD]
H --> I[EKS Cluster]
end
subgraph "Application Layer"
I --> J[Django App Pods]
I --> K[MySQL Database]
I --> L[EFS Storage]
end
subgraph "Networking"
M[Route 53] --> N[ACM Certificate]
N --> O[AWS ALB]
O --> J
end
subgraph "Monitoring"
P[Prometheus] --> Q[Grafana Dashboards]
R[AlertManager] --> S[Email Alerts]
end
J --> P
K --> P
| Technology | Purpose | Version |
|---|---|---|
| Terraform | Infrastructure as Code | 1.0+ |
| AWS EKS | Kubernetes cluster | 1.24+ |
| AWS ECR | Container registry | - |
| AWS EFS | Persistent storage | - |
| AWS ALB | Load balancer | - |
| AWS ACM | SSL certificates | - |
| Route 53 | DNS management | - |
| Technology | Purpose | Version |
|---|---|---|
| Jenkins | CI/CD pipeline | 2.375+ |
| ArgoCD | GitOps deployment | 2.5+ |
| Docker | Containerization | 20.0+ |
| GitHub | Source code & GitOps repo | - |
| Technology | Purpose | Version |
|---|---|---|
| Prometheus | Metrics collection | 2.40+ |
| Grafana | Visualization & dashboards | 9.0+ |
| AlertManager | Alert management | 0.24+ |
| Technology | Purpose | Version |
|---|---|---|
| Python Django | Web application | 4.0+ |
| MySQL | Database | 8.0+ |
| Kubernetes | Container orchestration | 1.24+ |
- π Automated CI/CD Pipeline - Jenkins builds, tests, and deploys on every commit
- π― GitOps Workflow - ArgoCD automatically syncs Kubernetes manifests from Git
- ποΈ Infrastructure as Code - Complete AWS infrastructure managed with Terraform
- π Comprehensive Monitoring - Prometheus metrics with Grafana dashboards
- π Security First - RBAC, secrets management, and network security groups
- π Scalable Architecture - Kubernetes with auto-scaling and load balancing
- πΎ Persistent Storage - EFS-backed storage for database and application data
- π Production Ready - SSL termination, custom domain, and high availability
- β AWS account with appropriate permissions
- β S3 bucket for Terraform backend (create manually first)
- β Domain name for Route 53 (optional but recommended)
- β GitHub account
- β Personal access token with repo permissions
- β
Two repositories:
- Main application repository
- GitOps repository for Kubernetes manifests
git clone https://github.com/yourusername/end-to-end-devops.git
cd end-to-end-devopsaws configure
# Enter your AWS Access Key ID, Secret Access Key, and default region (ap-southeast-1)aws s3 mb s3://terraform-devops-backend-file --region ap-southeast-1cd terraform
terraform init
terraform plan
terraform apply -auto-approveFollow the detailed setup guide below for complete configuration.
- Update the S3 bucket name in
terraform/provider.tf:
terraform {
backend "s3" {
bucket = "your-terraform-backend-bucket"
region = "ap-southeast-1"
key = "terraform.tfstate"
encrypt = true
use_lockfile = true
}
}cd terraform
terraform init
terraform plan
terraform apply -auto-approveThis will create:
- β VPC with public/private subnets
- β EKS cluster
- β ECR repository
- β EFS file system
- β EC2 instance for Jenkins
- β Route 53 hosted zone
- β ACM certificate
aws eks update-kubeconfig --region ap-southeast-1 --name your-eks-cluster-name
kubectl get nodes# Get the public IP of your Jenkins EC2 instance
aws ec2 describe-instances \
--filters "Name=tag:Name,Values=Jenkins-Server" \
--query 'Reservations[].Instances[].PublicIpAddress' \
--output text
# SSH to the server
ssh -i your-key.pem ubuntu@<jenkins-public-ip>Follow the installation guide in Install-and-Configuration/Jenkins, Docker and AWS CLi installation.txt
- Access Jenkins UI (http://jenkins-public-ip:8080)
- Add GitHub token as credential:
- Go to Manage Jenkins > Credentials > System > Global credentials
- Add new credential:
- Kind: Secret text
- ID:
GITHUB_TOKEN - Secret: Your GitHub personal access token
- Create new Pipeline job
- Configure webhook trigger from GitHub
- Use the Jenkinsfile from
jenkins-cicd/Jenkinsfile
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yamlkubectl port-forward svc/argocd-server -n argocd 8080:443
# Access https://localhost:8080
# Default username: admin
# Get password: kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d- Create application pointing to your GitOps repository
- Set path to
Kubernetes-with-ArgoCD/ - Enable auto-sync
- Update image references in Kubernetes manifests
- Configure database credentials in secrets
- Update domain name in ingress configuration
kubectl apply -f "Kubernetes-with-ArgoCD/"kubectl create namespace monitoring
kubectl apply -f "Install-and-Configuration/prometheus yml file.txt"kubectl apply -f "Install-and-Configuration/Grafana installation.txt"- Access Grafana (port-forward or ingress)
- Import Prometheus as data source
- Import monitoring dashboards
- π Metrics collection from Kubernetes pods
- π Custom metrics for application health
β οΈ Alert rules for critical failures
- ποΈ Kubernetes cluster overview
- π Application performance metrics
- ποΈ Database monitoring
- π Jenkins pipeline status
- π§ Email alerts for pipeline failures
- π₯ Service health monitoring
- πΎ Resource utilization alerts
end-to-end-devops/
βββ π terraform/ # Infrastructure as Code
β βββ π ec2/ # EC2 instance configuration
β βββ π eks/ # EKS cluster setup
β βββ π ecr/ # ECR repository
β βββ π efs/ # EFS file system
β βββ π vpc/ # VPC and networking
βββ π jenkins-cicd/ # CI/CD pipeline
β βββ π app/ # Django application
β βββ π Jenkinsfile # Jenkins pipeline definition
βββ π Kubernetes-with-ArgoCD/ # Kubernetes manifests
βββ π Install-and-Configuration/ # Setup scripts and configs
βββ π Other-service/ # Additional services
terraform/- Infrastructure as Codejenkins-cicd/Jenkinsfile- CI/CD pipelineKubernetes-with-ArgoCD/- Kubernetes manifestsInstall-and-Configuration/- Setup scripts and configs
export AWS_REGION=ap-southeast-1
export AWS_ACCOUNT_ID=your-account-id
export GITHUB_TOKEN=your-github-token# If S3 backend doesn't exist
aws s3 mb s3://terraform-devops-backend-file --region ap-southeast-1
# If backend configuration is incorrect
terraform init -reconfigure# Update kubeconfig
aws eks update-kubeconfig --region ap-southeast-1 --name your-cluster-name
# Verify cluster access
kubectl get nodes- β Check GitHub token permissions
- β Verify ECR repository access
- β Ensure Docker is running on Jenkins server
- β
Check Jenkins logs:
sudo journalctl -u jenkins -f
- β Verify GitOps repository access
- β Check Kubernetes manifest syntax
- β
Review ArgoCD application logs:
kubectl logs -n argocd deployment/argocd-server
# Check pod status
kubectl get pods -n default
# Check pod logs
kubectl logs <pod-name>
# Check events
kubectl get events --sort-by='.lastTimestamp'
# Describe pod for detailed info
kubectl describe pod <pod-name># Check EKS cluster status
aws eks describe-cluster --name your-cluster-name --region ap-southeast-1
# List ECR repositories
aws ecr describe-repositories --region ap-southeast-1
# Check EFS mount targets
aws efs describe-mount-targets --file-system-id your-efs-id# Check all resources
kubectl get all --all-namespaces
# Check ArgoCD application status
kubectl get applications -n argocd
# Port forward services
kubectl port-forward svc/argocd-server -n argocd 8080:443# Monitor Jenkins logs
sudo journalctl -u jenkins -f
# Check Jenkins status
sudo systemctl status jenkinsWe welcome contributions! Please follow these steps:
- π΄ Fork the repository
- πΏ Create a feature branch (
git checkout -b feature/amazing-feature) - πΎ Commit your changes (
git commit -m 'Add amazing feature') - π Push to the branch (
git push origin feature/amazing-feature) - π Open a Pull Request
- π Test your changes thoroughly
- π Update documentation as needed
- π― Follow existing code style
- β Ensure all tests pass
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- π Create an issue in the GitHub repository
- π Check the troubleshooting section above
- π Review the configuration files for reference
- π¬ Join our community discussions
Production Use: This project is for educational and demonstration purposes. Please review and modify configurations according to your specific requirements and security policies before using in production environments.
Security: Always use strong passwords, rotate credentials regularly, and follow AWS security best practices.
Costs: Be aware of AWS costs associated with running this infrastructure. Consider using AWS Free Tier for learning purposes.
Made with β€οΈ for the DevOps community