A fully automated CI/CD pipeline that builds, tests, and deploys a Python web terminal application using Jenkins, Docker, and Kubernetes.
- Source Control: GitHub
- CI/CD: Jenkins (with webhook automation)
- Containerization: Docker
- Orchestration: Kubernetes (Minikube)
- Application: Flask-based Python web terminal
-
Flask Application (
app.py)- Web-based terminal interface
- Command execution API
- Real-time output display
-
Docker Container
- Base: Python 3.9-slim
- Exposed Port: 5001
- Auto-built on code changes
-
Kubernetes Deployment
- 2 replica pods for high availability
- NodePort service (30080)
- Auto-rolling updates
-
Jenkins Pipeline
- Automated GitHub webhook triggers
- Multi-stage pipeline (Clone → Build → Test → Deploy)
- Console output logging
- Clone Repository - Fetch latest code from GitHub
- Build Docker Image - Create containerized application
- Run Tests - Execute pytest suite
- Deploy to Kubernetes - Rolling update deployment
- Application: http://107.20.172.71:30080
- Jenkins: http://107.20.172.71:8080
- GitHub Repo: [Your repository URL]
- Developer pushes code to GitHub
- GitHub webhook triggers Jenkins build
- Jenkins clones repository
- Docker image is built with new code
- Automated tests run
- If tests pass, Kubernetes deployment updates
- Application is live with zero downtime
# Make a code change
vim templates/index.html
# Commit and push
git add .
git commit -m "Test CI/CD pipeline"
git push origin main
# Watch Jenkins automatically build and deployDevops/
├── app.py # Flask application
├── Dockerfile # Container definition
├── deployment.yaml # Kubernetes deployment
├── service.yaml # Kubernetes service
├── requirements.txt # Python dependencies
├── test_app.py # Pytest tests
├── templates/
│ └── index.html # Web terminal UI
├── Jenkinsfile # Pipeline definition
└── README.md # This file
# Build image
docker build -t python-terminal:latest .
# Run locally
docker run -p 5001:5001 python-terminal:latest
# List images
docker images# Apply deployment
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
# Check status
kubectl get pods
kubectl get deployments
kubectl get services
# View logs
kubectl logs <pod-name>
# Delete resources
kubectl delete -f deployment.yaml
kubectl delete -f service.yaml# Check status
git status
# Stage changes
git add .
# Commit
git commit -m "Your message"
# Push to GitHub
git push origin main
# View history
git log --oneline# Check Jenkins logs
kubectl logs -n jenkins <jenkins-pod>
# Verify webhook
# GitHub repo → Settings → Webhooks → Check recent deliveries# Check pod status
kubectl get pods
# View pod logs
kubectl logs <pod-name>
# Describe pod
kubectl describe pod <pod-name># Check service
kubectl get svc python-terminal-service
# Verify NodePort
kubectl describe svc python-terminal-service
# Check Minikube IP
minikube ip- Add staging environment
- Implement blue-green deployment
- Add monitoring with Prometheus/Grafana
- Set up automated backups
- Add security scanning (Trivy/Snyk)
- Implement GitOps with ArgoCD
- Add load balancing
- Set up logging with ELK stack
Rishaan Yadav Jayanth Nair Dhruv Veragiwala
MIT License