Before: 3 pods ran ENABLED_SERVICES=all — gateway, auth, and every
business-logic service co-hosted. This defeated the purpose of the
gateway pattern and prevented independent scaling.
After:
sor-gateway (2 replicas) — ENABLED_SERVICES=gateway,auth
• WebSocket edge, accepts client connections
• Auth co-located (JWT validation is a localhost gRPC call, no network hop)
• Lighter resource footprint: 150m/128Mi request, 500m/512Mi limit
• Ingress at hub.aeternalisgames.com → sor-gateway:80
sor-workers (3 replicas) — ENABLED_SERVICES=chat,collection,bazaar,
content,versioning,matchmaking,game
• Subscribes to NATS, handles all business-logic messages
• Holds DB connection pools for all schemas
• Internal only — no ingress
• Heavier resources: 300m/384Mi request, 1000m/1Gi limit
configmap.yaml: removed ENABLED_SERVICES=all and Services__Auth (each
deployment now sets these directly in its own env block)
ingress.yaml: hub.aeternalisgames.com backend sor-host → sor-gateway
ArgoCD prune=true will delete the old sor-host Deployment + Service
from the cluster on next sync.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
62 lines
2.2 KiB
YAML
62 lines
2.2 KiB
YAML
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: sor-ingress
|
|
namespace: stone-server
|
|
annotations:
|
|
# cert-manager: automatically provision / renew Let's Encrypt certs.
|
|
# TODO: verify your cluster-issuer name (run: kubectl get clusterissuer -A).
|
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
|
|
|
# Nginx: keep WebSocket connections open for up to 1 hour.
|
|
# Required so clients don't get disconnected mid-game by proxy timeouts.
|
|
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
|
|
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
|
|
nginx.ingress.kubernetes.io/proxy-connect-timeout: "60"
|
|
|
|
# Nginx will forward HTTP → HTTPS and handle the WebSocket Upgrade header.
|
|
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
|
|
|
spec:
|
|
ingressClassName: nginx
|
|
|
|
tls:
|
|
# hub.aeternalisgames.com — game server + WebSocket gateway.
|
|
# hub-tls already exists in this namespace (your existing Let's Encrypt cert).
|
|
- hosts:
|
|
- hub.aeternalisgames.com
|
|
secretName: hub-tls
|
|
|
|
# control.aeternalisgames.com — admin portal.
|
|
# cert-manager will auto-provision this cert on first deployment.
|
|
# TODO: ensure DNS A record for control.aeternalisgames.com points to your ingress IP.
|
|
- hosts:
|
|
- control.aeternalisgames.com
|
|
secretName: control-tls
|
|
|
|
rules:
|
|
# ── Game server / WebSocket gateway ────────────────────────────────────────
|
|
- host: hub.aeternalisgames.com
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: sor-gateway
|
|
port:
|
|
number: 80
|
|
|
|
# ── Admin portal ───────────────────────────────────────────────────────────
|
|
# Hosted on a separate subdomain to avoid SignalR/Blazor path conflicts.
|
|
- host: control.aeternalisgames.com
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: sor-admin
|
|
port:
|
|
number: 80
|