Kubernetes
Quick Start
Deploy Rivet Engine to Kubernetes with PostgreSQL storage.
1. Create Namespace
Save as namespace.yaml:
Apply:
2. Deploy PostgreSQL
Save as postgres.yaml:
Apply and wait for PostgreSQL to be ready:
3. Deploy Rivet Engine
The Rivet Engine deployment consists of two components:
- 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 and memory utilization.
- Singleton Engine Deployment: Runs singleton services that must have exactly 1 replica (e.g., schedulers, coordinators).
Save as rivet-engine.yaml:
Apply and wait for the engine to be ready:
Note: The HPA requires a metrics server to be running in your cluster. Most Kubernetes distributions (including k3d, GKE, EKS, AKS) include this by default.
4. Verify Deployment
Check that all pods are running (you should see 2+ engine pods and 1 singleton pod):
5. Access the Engine
Get the service URL:
Test the health endpoint:
Expected response:
Local Development with k3d
For local Kubernetes testing with k3d:
Cleanup:
Production Setup
Security
- Change PostgreSQL password in
postgres-secret - Use TLS for external access (configure ingress controller)
- Set admin token via environment variable:
YAML
Scaling
The engine is configured with Horizontal Pod Autoscaling (HPA) by default, automatically scaling between 2-10 replicas based on CPU (60%) and memory (80%) utilization.
To adjust the scaling parameters, modify the HPA configuration:
Monitor HPA status:
Next Steps
- See Configuration for all options
- For advanced multi-datacenter setup, see the GitHub repository