Quick Start: Deploy to Digital Ocean
Brouillon : cette page n'a pas encore été relue et peut être incomplète ou inexacte.
This is a condensed version for quickly deploying to Digital Ocean. For detailed instructions, see DEPLOY-DIGITAL-OCEAN.md.
Prerequisites
Section intitulée « Prerequisites »# Install doctlbrew install doctl # macOS# or download from: https://github.com/digitalocean/doctl/releases
# Authenticatedoctl auth init# Paste your API token from: https://cloud.digitalocean.com/account/api/tokensStep 1: Create Kubernetes Cluster
Section intitulée « Step 1: Create Kubernetes Cluster »# Create cluster (takes ~5 minutes)doctl kubernetes cluster create kili-shops-test \ --region nyc1 \ --version 1.28.2-do.0 \ --node-pool "name=worker-pool;size=s-2vcpu-4gb;count=3"
# Configure kubectldoctl kubernetes cluster kubeconfig save kili-shops-test
# Verifykubectl get nodesStep 2: Setup Container Registry
Section intitulée « Step 2: Setup Container Registry »# Create registrydoctl registry create kili-shops
# Logindoctl registry loginStep 3: Deploy Backend
Section intitulée « Step 3: Deploy Backend »cd /Users/moise/projects/af-corp/kili-shops-microservices
# Build and push images./scripts/do-build-and-push.sh
# Deploy with Helm./scripts/do-deploy.sh
# Wait for Load Balancer IP (2-3 minutes)kubectl get service api-gateway -w
# Save the EXTERNAL-IP when it appearsexport BACKEND_IP=<your-external-ip>Step 4: Deploy Frontend
Section intitulée « Step 4: Deploy Frontend »cd /Users/moise/projects/af-corp/kilimmanjaro
# Build and push frontend imageREACT_APP_API_URL="http://${BACKEND_IP}/api" ./scripts/do-build-and-push.sh
# Deploy with Helm./scripts/do-deploy.sh ${BACKEND_IP}
# Wait for Load Balancer IP (2-3 minutes)kubectl get service kilimmanjaro-frontend -w
# Save the EXTERNAL-IPexport FRONTEND_IP=<your-external-ip>Step 5: Access Application
Section intitulée « Step 5: Access Application »echo "Frontend: http://${FRONTEND_IP}"echo "Backend API: http://${BACKEND_IP}"
# Open in browseropen "http://${FRONTEND_IP}"Verify Deployment
Section intitulée « Verify Deployment »# Check all pods are runningkubectl get pods
# Test backend APIcurl http://${BACKEND_IP}/health
# Test frontendcurl http://${FRONTEND_IP}/healthConfigure DNS (Optional)
Section intitulée « Configure DNS (Optional) »Add A records in your DNS provider:
test.kilimmanjaro.com→${FRONTEND_IP}api.test.kilimmanjaro.com→${BACKEND_IP}
Then rebuild frontend with domain:
cd /Users/moise/projects/af-corp/kilimmanjaroREACT_APP_API_URL="http://api.test.kilimmanjaro.com/api" ./scripts/do-build-and-push.shkubectl rollout restart deployment/kilimmanjaro-frontend# Delete applicationshelm uninstall kilimmanjarohelm uninstall kili-shops
# Delete PVCskubectl delete pvc --all
# Delete clusterdoctl kubernetes cluster delete kili-shops-test
# Delete registrydoctl registry delete kili-shops~$98/month:
- Kubernetes: 3 nodes × $24 = $72
- Load Balancers: 2 × $12 = $24
- Storage: ~$2
Troubleshooting
Section intitulée « Troubleshooting »# View pod statuskubectl get pods
# View logskubectl logs -f deployment/api-gatewaykubectl logs -f deployment/kilimmanjaro-frontend
# Describe podkubectl describe pod <pod-name>
# Check eventskubectl get events --sort-by=.metadata.creationTimestampNext Steps
Section intitulée « Next Steps »- Full Deployment Guide - Detailed instructions
- Kubernetes Guide - General K8s documentation
- Setup monitoring and logging
- Configure HTTPS with cert-manager
- Setup CI/CD pipeline