|
| 1 | +# Rivet Engine Kubernetes Quick Deployment |
| 2 | + |
| 3 | +**For the complete deployment guide, see the [Kubernetes documentation](https://rivet.gg/docs/self-hosting/kubernetes).** |
| 4 | + |
| 5 | +This guide is for developers who have already cloned the repository and want to deploy locally. |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +- Kubernetes cluster (v1.24+) |
| 10 | +- `kubectl` configured |
| 11 | +- Metrics server (required for HPA) - included by default in most distributions |
| 12 | + |
| 13 | +## Architecture |
| 14 | + |
| 15 | +The Rivet Engine deployment consists of two components: |
| 16 | + |
| 17 | +- **Main Engine Deployment**: Runs all services except singleton services. Configured with Horizontal Pod Autoscaling (HPA) to automatically scale between 2-10 replicas based on CPU (60%) and memory (80%) utilization. |
| 18 | +- **Singleton Engine Deployment**: Runs singleton services that must have exactly 1 replica (e.g., schedulers, coordinators). |
| 19 | + |
| 20 | +## Deploy |
| 21 | + |
| 22 | +```bash |
| 23 | +# Apply all manifests |
| 24 | +kubectl apply -f engine/ |
| 25 | + |
| 26 | +# Wait for pods |
| 27 | +kubectl -n rivet-engine wait --for=condition=ready pod -l app=postgres --timeout=300s |
| 28 | +kubectl -n rivet-engine wait --for=condition=ready pod -l app=rivet-engine --timeout=300s |
| 29 | +kubectl -n rivet-engine wait --for=condition=ready pod -l app=rivet-engine-singleton --timeout=300s |
| 30 | +``` |
| 31 | + |
| 32 | +## Verify |
| 33 | + |
| 34 | +```bash |
| 35 | +# Check pods (you should see 2+ engine pods and 1 singleton pod) |
| 36 | +kubectl -n rivet-engine get pods |
| 37 | + |
| 38 | +# Check HPA status |
| 39 | +kubectl -n rivet-engine get hpa |
| 40 | + |
| 41 | +# Port forward |
| 42 | +kubectl -n rivet-engine port-forward svc/rivet-engine 6420:6420 6421:6421 |
| 43 | + |
| 44 | +# Test health |
| 45 | +curl http://localhost:6421/health |
| 46 | +``` |
| 47 | + |
| 48 | +Expected response: |
| 49 | +```json |
| 50 | +{"runtime":"engine","status":"ok","version":"..."} |
| 51 | +``` |
| 52 | + |
| 53 | +## Logs |
| 54 | + |
| 55 | +```bash |
| 56 | +# View main engine logs |
| 57 | +kubectl -n rivet-engine logs -l app=rivet-engine -f |
| 58 | + |
| 59 | +# View singleton engine logs |
| 60 | +kubectl -n rivet-engine logs -l app=rivet-engine-singleton -f |
| 61 | +``` |
| 62 | + |
| 63 | +## Cleanup |
| 64 | + |
| 65 | +```bash |
| 66 | +kubectl delete namespace rivet-engine |
| 67 | +``` |
| 68 | + |
| 69 | +## Next Steps |
| 70 | + |
| 71 | +See [README.md](README.md) for more deployment options and [the documentation](https://rivet.gg/docs/self-hosting/kubernetes) for production setup. |
0 commit comments