Tenant Service — Deployment Topology
Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template · 17 Technology Stack
1. Runtime summary
| Property | Value |
|---|---|
| Runtime | Node.js 22 LTS |
| Framework | NestJS 11 |
| Package | @ghasi/service-tenant |
| HTTP port | 3002 |
| Healthcheck | GET /health |
2. Container topology
3. Scaling policy
| Dimension | Value |
|---|---|
| Min replicas | 3 |
| Max replicas | 8 |
| Scale trigger | CPU ≥ 60% avg over 90 s |
| Scale-in cooldown | 5 min |
| Pod anti-affinity | requiredDuringSchedulingIgnoredDuringExecution across zones |
| Resource request | cpu: 200m, memory: 256Mi |
| Resource limit | cpu: 800m, memory: 512Mi |
4. Environment variables
| Variable | Description |
|---|---|
DATABASE_URL | PostgreSQL primary connection string |
REDIS_URL | Redis connection string |
NATS_URL | NATS JetStream URL |
TENANT_IDENTITY_SERVICE_URL | identity-service internal base URL |
TENANT_FACILITY_SERVICE_URL | facility-service internal base URL |
TENANT_SUBSCRIPTION_EXPIRY_CRON | Cron schedule (default 0 5 0 * * *) |
OTEL_EXPORTER_OTLP_ENDPOINT | OTel collector |
OTEL_SERVICE_NAME | tenant-service |
5. Network policies
| Source | Destination | Port |
|---|---|---|
| Kong | tenant-service | 3002 |
| tenant-service | PostgreSQL | 5432 |
| tenant-service | Redis | 6379 |
| tenant-service | NATS | 4222 |
| tenant-service | identity-service /internal/* | 3001 |
| tenant-service | facility-service /internal/* | 3003 |
| Any service | tenant-service /internal/tenant/* | 3002 (cluster CIDR only) |