This guide provides detailed instructions for setting up the Face Detection App deployment environment.
Before beginning the installation, ensure you have:
- 🔑 AWS Account with appropriate permissions
- 📦 Git installed
- 💻 Terminal access
- 👑 Sudo/Administrator privileges
git clone --recursive https://github.com/DanorSODA/Devops-Course-Final-Project
cd Devops-Course-Final-Projectchmod +x install.sh
./install.shThe installation script will:
- 🔍 Detect your operating system
- 📦 Install required dependencies
- ⚙️ Configure necessary tools
- ✅ Verify installations
aws configurecd terraform
terraform initterraform plan
terraform validate
terraform apply
terraform outputYou should see outputs like: prod_master_public_ip = "X.X.X.X" prod_worker_public_ips = ["X.X.X.X", "X.X.X.X"] staging_master_public_ip = "Y.Y.Y.Y" staging_worker_public_ips = ["Y.Y.Y.Y", "Y.Y.Y.Y"]
The Terraform configuration creates an SSH key pair. The private key is saved as face-detection-ssh-key.pem in the terraform directory.
Test the connection to the master node:
ssh -i terraform/face-detection-ssh-key.pem ubuntu@<prod/staging_master_public_ip>Copy deployment files to master node:
scp -i terraform/face-detection-ssh-key.pem -r k8s/deployments/*.yaml ubuntu@<prod/staging_master_public_ip>:~/k8s/deployments/SSH into master node:
ssh -i terraform/face-detection-ssh-key.pem ubuntu@<prod/staging_master_public_ip>Apply Kubernetes configurations:
cd ~/k8s/deployments/
# Create namespace first
kubectl apply -f face-detection-namespace.yaml
# Apply other resources in the namespace
kubectl apply -f face-detection-config.yaml
kubectl apply -f face-detection-deployment.yaml
kubectl apply -f face-detection-service.yaml
kubectl apply -f face-detection-ingress.yamlkubectl get pods -n face-detection
kubectl get services -n face-detection
kubectl get ingress -n face-detectionCheck pod status:
kubectl get pods -n face-detection -o wideCheck service status:
kubectl get services -n face-detectionCheck ingress status:
kubectl get ingress -n face-detectionCheck logs:
kubectl logs -l app=face-detection -n face-detectionTest the application:
curl http://<prod/staging_ingress_host>/api/v1/detectAfter successful deployment, you need to set up GitHub Secrets for the CD pipeline to work:
- Get the production master node IP:
cd terraform
terraform output prod_master_public_ip- Get the SSH private key content:
cat terraform/face-detection-ssh-key.pem-
Add secrets to GitHub:
- Go to your GitHub repository
- Navigate to
Settings>Secrets and variables>Actions - Click
New repository secret - Add the following secrets:
a. Add Master IP:
- Name:
MASTER_IP - Value: [Your master node IP from step 1]
b. Add SSH Private Key:
- Name:
FACE_DETECTION_SSH_PRIVATE_KEY - Value: [Your SSH private key content from step 2]
These secrets are required for:
- 🔄 GitHub Actions to connect to your Kubernetes cluster
- 🚀 Automated deployment updates
- ⚡ Continuous deployment pipeline
Verify the secrets are set correctly in your GitHub repository settings before running any workflows.
-
AWS CLI Configuration Issues
- ✅ Check credentials configuration
- 🌍 Verify region settings
- 🔍 Test AWS CLI access
-
Terraform Deployment Issues
- ⚙️ Verify AWS provider configuration
- 🔄 Check resource dependencies
- 📝 Review error messages
-
Kubernetes Deployment Issues
- 🔍 Check pod status
- ⚙️ Review service configurations
- 🌐 Verify ingress setup
aws configure list
aws sts get-caller-identityterraform validate
terraform plankubectl describe pods
kubectl describe services
kubectl describe ingressFor more information, please refer to the project documentation.