routing-engine — Deployment Topology
Status: populated | Last updated: 2026-04-18
1. Kubernetes Resources
Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: routing-engine
namespace: sms-gateway
labels:
app: routing-engine
version: "1.0.0"
spec:
replicas: 3
selector:
matchLabels:
app: routing-engine
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
metadata:
labels:
app: routing-engine
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "3001"
prometheus.io/path: "/metrics"
spec:
serviceAccountName: routing-engine
containers:
- name: routing-engine
image: ghcr.io/ghasitech/routing-engine:1.0.0
ports:
- containerPort: 50051 # gRPC
name: grpc
- containerPort: 3001 # HTTP management
name: http-mgmt
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: routing-engine-secrets
key: database-url
- name: REDIS_URL
valueFrom:
secretKeyRef:
name: routing-engine-secrets
key: redis-url
- name: NATS_URL
value: "nats://nats.sms-gateway.svc.cluster.local:4222"
- name: LOG_LEVEL
value: "info"
volumeMounts:
- name: tls-certs
mountPath: /run/secrets/tls
readOnly: true
- name: nats-creds
mountPath: /run/secrets/nats
readOnly: true
resources:
requests:
cpu: "200m"
memory: "256Mi"
limits:
cpu: "1000m"
memory: "512Mi"
livenessProbe:
httpGet:
path: /health
port: 3001
initialDelaySeconds: 10
periodSeconds: 15
readinessProbe:
httpGet:
path: /ready
port: 3001
initialDelaySeconds: 5
periodSeconds: 10
volumes:
- name: tls-certs
secret:
secretName: routing-engine-tls
- name: nats-creds
secret:
secretName: routing-engine-nats-creds
Service (ClusterIP)
apiVersion: v1
kind: Service
metadata:
name: routing-engine
namespace: sms-gateway
spec:
selector:
app: routing-engine
ports:
- name: grpc
port: 50051
targetPort: 50051
- name: http-mgmt
port: 3001
targetPort: 3001
type: ClusterIP
HorizontalPodAutoscaler
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: routing-engine
namespace: sms-gateway
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: routing-engine
minReplicas: 3
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 60
- type: Pods
pods:
metric:
name: routing_engine_grpc_requests_total
target:
type: AverageValue
averageValue: "500"
2. Environments
| Environment | Replicas | DB | Redis |
|---|---|---|---|
development | 1 | Local Docker Compose | Local Docker Compose |
staging | 2 | Shared staging cluster (ops_routing schema) | Shared staging Redis |
production | 3 (min) → 10 (max via HPA) | RDS PostgreSQL read replica | ElastiCache Redis cluster |
3. Network Topology
[sms-orchestrator pod]
│
│ gRPC :50051 (mTLS, ClusterIP)
▼
[routing-engine pods × 3]
│ │
│ TCP :5432 │ TCP :6379
▼ ▼
[PostgreSQL read replica] [Redis cluster]
[NATS JetStream] ──► routing-engine (consumer, operator.health subject)
routing-engine is NOT exposed via Kong Gateway. It is a cluster-internal service only.