DevOps Final Project | Kubernetes on AWS with Full CI/CD Automation
| Field | Value |
|---|---|
| Name | Alex Ivanov |
| GitHub | TechEX-Final |
- Architecture
- Prerequisites
- Clone the Repository
- Configure GitHub Secrets
- Deploy
- Find the Application URL
- Troubleshooting
- Cleanup
Internet
│
┌─────────▼─────────┐
│ Load Balancer │ ← Port 80
│ (AWS ALB) │
└─────────┬─────────┘
│
┌───────────────┼───────────────┐
│ │ │
┌────▼────┐ ┌────▼────┐ ┌────▼────┐
│ Master │ │ Worker1 │ │ Worker2 │
│10.0.1.10│ │10.0.1.11│ │10.0.2.11│
│ +NFS │ │NodePort │ │NodePort │
└────┬────┘ └────┬────┘ └────┬────┘
│ │ │
└──────────────┴──────────────┘
NFS Share
/srv/nfs/techex-data
| Stage | Description |
|---|---|
| 1. Test | Run Python unit tests |
| 2. Build | Build & push Docker image to Docker Hub |
| 3. Infrastructure | Terraform provisions 3 EC2s + ALB |
| 4. Configure | Join workers to K8s cluster + mount NFS |
| 5. Deploy | Helm deploys app to Kubernetes |
| Component | Version |
|---|---|
| Kubernetes | 1.29 |
| Terraform | 1.6+ |
| Flask | 3.0 |
| Python | 3.11 |
| Ubuntu | 22.04 |
- GitHub Account - To host the repository
- Docker Hub Account - To store the container image
- AWS Academy Account - To deploy infrastructure
git --version# Clone the repository (or fork it first)
git clone https://github.com/DevOOPS-Technion/TechEX-Final.git
# Navigate to the project folder
cd TechEX-Final- Go to AWS Academy
- Open your Learner Lab
- Click AWS Details (on the right side)
- Click Show next to AWS CLI
- You'll see:
[default] aws_access_key_id=ASIA... aws_secret_access_key=... aws_session_token=... - Copy each value
- Go to Docker Hub
- Click your username → Account Settings
- Click Security → New Access Token
- Give it a name (e.g., "TechEX") and click Generate
- Copy the token (you won't see it again!)
- Go to your GitHub repository
- Click Settings (tab)
- Click Secrets and variables → Actions
- Click New repository secret
- Add these 5 secrets one by one:
| Secret Name | Value | Description |
|---|---|---|
AWS_ACCESS_KEY_ID |
ASIA... |
From AWS Academy |
AWS_SECRET_ACCESS_KEY |
(long string) | From AWS Academy |
AWS_SESSION_TOKEN |
(very long string) | From AWS Academy |
DOCKERHUB_USERNAME |
Your username | Docker Hub username |
DOCKERHUB_TOKEN |
Your token | Docker Hub access token |
Since AWS Academy credentials expire, update them before deploying:
- Go to AWS Academy → Learner Lab → AWS Details → Show
- In GitHub → Settings → Secrets → Actions
- Update these 3 secrets with new values:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_SESSION_TOKEN
Before deploying, ensure your AWS Academy lab is started and credentials are updated in GitHub secrets.
# Stage all files
git add .
# Commit changes
git commit -m "Deploy TechEX application"
# Push to GitHub (triggers CI/CD)
git push origin main- Go to your GitHub repository
- Click Actions tab
- Click on the running workflow "TechEX Deploy"
- Watch all 5 stages complete:
- ✅ 1. Test
- ✅ 2. Build
- ✅ 3. Infrastructure
- ✅ 4. Configure
- ✅ 5. Deploy
⏱️ Total time: ~15-20 minutes
- Go to Actions → Latest workflow run
- Click on 5. Deploy job
- Expand Summary step
- Find the URL:
🌐 Application URL: http://techex-lb-XXXXXXXXXX.us-east-1.elb.amazonaws.com
- Go to AWS Console (via AWS Academy)
- Navigate to EC2 → Load Balancers
- Find
techex-lb - Copy the DNS name
curl http://<your-load-balancer-dns>/healthExpected response:
{
"status": "healthy",
"version": "2.0",
"data_persistence": true
}Once deployed, see the Application Guide to learn how to:
- Navigate the web interface
- Add and manage parcels
- View statistics
- Use the API endpoints
Cause: AWS credentials expired or invalid
Solution:
- Go to AWS Academy → Start Lab (if stopped)
- Get fresh credentials (AWS Details → Show)
- Update all 3 AWS secrets in GitHub
- Re-run the workflow
Cause: AWS session token expired (they last ~4 hours)
Solution: Same as above - get fresh credentials from AWS Academy
Wait 5-10 minutes for health checks to pass, then:
# SSH to master (get IP from GitHub Actions output)
ssh -i techex.pem ubuntu@<master-ip>
# Check if pods are running
kubectl get pods -n techex
# Check pod logs
kubectl logs -n techex -l app=techex
# Check nodes
kubectl get nodes# SSH to master
ssh -i techex.pem ubuntu@<master-ip>
# Check NFS share
ls -la /srv/nfs/techex-data/
# Check if file exists
cat /srv/nfs/techex-data/parcels.json# On master, check join command
cat /home/ubuntu/join-command.sh
# Check nodes status
kubectl get nodes
# Check kubelet on worker
ssh ubuntu@<worker-ip> 'sudo systemctl status kubelet'First, update AWS credentials, then:
cd terraform
terraform destroy -auto-approve- EC2 → Instances → Terminate all
techex-*instances - EC2 → Load Balancers → Delete
techex-lb - EC2 → Target Groups → Delete
techex-tg - EC2 → Security Groups → Delete
techex-*groups - VPC → Your VPCs → Delete
techex-vpc
TechEX-Final/
├── .github/workflows/cicd.yml # CI/CD Pipeline (5 stages)
├── ansible/ # Worker config (join + NFS)
├── docker/Dockerfile # Application container
├── terraform/ # AWS Infrastructure
│ ├── *.tf # Terraform configs
│ └── scripts/ # EC2 bootstrap scripts
├── web/ # Flask application
├── APPLICATION_GUIDE.md # Web app usage guide
└── README.md # This file
Built for DevOps Course 🎓
