55 lines
1.2 KiB
Markdown
55 lines
1.2 KiB
Markdown
# Simple Deployment Guide
|
|
|
|
## 🚀 One-Command Deploy
|
|
|
|
Just run this from the `kubernetes` folder:
|
|
|
|
```bash
|
|
./build-and-deploy.sh
|
|
```
|
|
|
|
This will:
|
|
1. ✅ Build both Docker images (FastAPI + Worker)
|
|
2. ✅ Deploy everything to Kubernetes
|
|
3. ✅ Set up auto-scaling
|
|
|
|
## 📋 What Gets Deployed
|
|
|
|
- **FastAPI:** 4 pods initially (scales 4-20 based on load)
|
|
- **Workers:** 2 pods initially (scales 2-10 based on load)
|
|
- **Auto-scaling:** Enabled for both
|
|
- **Pod Distribution:** Spreads across nodes automatically
|
|
|
|
## ✅ After Deployment
|
|
|
|
Check status:
|
|
```bash
|
|
kubectl get pods -n nats-backend
|
|
kubectl get services -n nats-backend
|
|
kubectl get hpa -n nats-backend
|
|
```
|
|
|
|
View logs:
|
|
```bash
|
|
kubectl logs -f deployment/fastapi-backend -n nats-backend
|
|
kubectl logs -f deployment/nats-worker -n nats-backend
|
|
```
|
|
|
|
Test FastAPI:
|
|
```bash
|
|
kubectl port-forward -n nats-backend service/fastapi-backend 8000:80
|
|
curl http://localhost:8000/health
|
|
```
|
|
|
|
## 🔧 Configuration
|
|
|
|
All settings are in `manifests/`:
|
|
- `secrets.yaml` - NATS credentials and external API
|
|
- `fastapi-deployment.yaml` - FastAPI config
|
|
- `worker-deployment.yaml` - Worker config
|
|
|
|
---
|
|
|
|
**That's it!** Everything is ready to deploy! 🎉
|
|
|