K8s changes for NATS

This commit is contained in:
dingo
2026-02-28 16:31:01 -05:00
parent d1a555cce7
commit e18cdc6b80
21 changed files with 1359 additions and 12 deletions
+88
View File
@@ -0,0 +1,88 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sor-bazaar
namespace: stone-server
labels:
app: sor-bazaar
spec:
replicas: 1
selector:
matchLabels:
app: sor-bazaar
template:
metadata:
labels:
app: sor-bazaar
spec:
imagePullSecrets:
- name: harbor-credentials
containers:
- name: sor-bazaar
image: registry.aeternalisgames.com/sor/sor-server:latest
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: sor-config
env:
- name: ENABLED_SERVICES
value: "bazaar"
- name: ConnectionStrings__Default
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: ConnectionStrings__Default
- name: ConnectionStrings__Redis
valueFrom:
secretKeyRef:
name: redis-credentials
key: connection-string
- name: Cdn__PublicBaseUrl
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: Cdn__PublicBaseUrl
- name: Cdn__EndpointUrl
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: Cdn__EndpointUrl
- name: Cdn__AccessKey
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: Cdn__AccessKey
- name: Cdn__SecretKey
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: Cdn__SecretKey
- name: Cdn__BucketName
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: Cdn__BucketName
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 15
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
resources:
requests:
cpu: "200m"
memory: "256Mi"
limits:
cpu: "750m"
memory: "768Mi"
+63
View File
@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sor-collection
namespace: stone-server
labels:
app: sor-collection
spec:
replicas: 1
selector:
matchLabels:
app: sor-collection
template:
metadata:
labels:
app: sor-collection
spec:
imagePullSecrets:
- name: harbor-credentials
containers:
- name: sor-collection
image: registry.aeternalisgames.com/sor/sor-server:latest
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: sor-config
env:
- name: ENABLED_SERVICES
value: "collection"
- name: ConnectionStrings__Default
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: ConnectionStrings__Default
- name: ConnectionStrings__Redis
valueFrom:
secretKeyRef:
name: redis-credentials
key: connection-string
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 15
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
resources:
requests:
cpu: "150m"
memory: "256Mi"
limits:
cpu: "500m"
memory: "512Mi"
+88
View File
@@ -0,0 +1,88 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sor-content
namespace: stone-server
labels:
app: sor-content
spec:
replicas: 1
selector:
matchLabels:
app: sor-content
template:
metadata:
labels:
app: sor-content
spec:
imagePullSecrets:
- name: harbor-credentials
containers:
- name: sor-content
image: registry.aeternalisgames.com/sor/sor-server:latest
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: sor-config
env:
- name: ENABLED_SERVICES
value: "content"
- name: ConnectionStrings__Default
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: ConnectionStrings__Default
- name: ConnectionStrings__Redis
valueFrom:
secretKeyRef:
name: redis-credentials
key: connection-string
- name: Cdn__PublicBaseUrl
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: Cdn__PublicBaseUrl
- name: Cdn__EndpointUrl
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: Cdn__EndpointUrl
- name: Cdn__AccessKey
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: Cdn__AccessKey
- name: Cdn__SecretKey
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: Cdn__SecretKey
- name: Cdn__BucketName
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: Cdn__BucketName
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 15
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
resources:
requests:
cpu: "150m"
memory: "256Mi"
limits:
cpu: "500m"
memory: "512Mi"
+63
View File
@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sor-game
namespace: stone-server
labels:
app: sor-game
spec:
replicas: 2
selector:
matchLabels:
app: sor-game
template:
metadata:
labels:
app: sor-game
spec:
imagePullSecrets:
- name: harbor-credentials
containers:
- name: sor-game
image: registry.aeternalisgames.com/sor/sor-server:latest
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: sor-config
env:
- name: ENABLED_SERVICES
value: "game"
- name: ConnectionStrings__Default
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: ConnectionStrings__Default
- name: ConnectionStrings__Redis
valueFrom:
secretKeyRef:
name: redis-credentials
key: connection-string
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 15
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
resources:
requests:
cpu: "300m"
memory: "384Mi"
limits:
cpu: "1000m"
memory: "1Gi"
+63
View File
@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sor-matchmaking
namespace: stone-server
labels:
app: sor-matchmaking
spec:
replicas: 1
selector:
matchLabels:
app: sor-matchmaking
template:
metadata:
labels:
app: sor-matchmaking
spec:
imagePullSecrets:
- name: harbor-credentials
containers:
- name: sor-matchmaking
image: registry.aeternalisgames.com/sor/sor-server:latest
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: sor-config
env:
- name: ENABLED_SERVICES
value: "matchmaking"
- name: ConnectionStrings__Default
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: ConnectionStrings__Default
- name: ConnectionStrings__Redis
valueFrom:
secretKeyRef:
name: redis-credentials
key: connection-string
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 15
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
resources:
requests:
cpu: "150m"
memory: "256Mi"
limits:
cpu: "500m"
memory: "512Mi"
+50
View File
@@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nats
namespace: stone-server
labels:
app: nats
spec:
replicas: 1
selector:
matchLabels:
app: nats
template:
metadata:
labels:
app: nats
spec:
containers:
- name: nats
image: nats:2.10-alpine
args:
- "-js"
- "-m"
- "8222"
ports:
- name: client
containerPort: 4222
- name: monitor
containerPort: 8222
livenessProbe:
tcpSocket:
port: 4222
initialDelaySeconds: 10
periodSeconds: 20
timeoutSeconds: 3
failureThreshold: 3
readinessProbe:
tcpSocket:
port: 4222
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
resources:
requests:
cpu: "50m"
memory: "64Mi"
limits:
cpu: "250m"
memory: "256Mi"
+63
View File
@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sor-versioning
namespace: stone-server
labels:
app: sor-versioning
spec:
replicas: 1
selector:
matchLabels:
app: sor-versioning
template:
metadata:
labels:
app: sor-versioning
spec:
imagePullSecrets:
- name: harbor-credentials
containers:
- name: sor-versioning
image: registry.aeternalisgames.com/sor/sor-server:latest
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: sor-config
env:
- name: ENABLED_SERVICES
value: "versioning"
- name: ConnectionStrings__Default
valueFrom:
secretKeyRef:
name: sor-app-secrets
key: ConnectionStrings__Default
- name: ConnectionStrings__Redis
valueFrom:
secretKeyRef:
name: redis-credentials
key: connection-string
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 15
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
resources:
requests:
cpu: "100m"
memory: "192Mi"
limits:
cpu: "300m"
memory: "384Mi"
+7 -7
View File
@@ -1,25 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sor-workers
name: sor-chat
namespace: stone-server
labels:
app: sor-workers
app: sor-chat
spec:
replicas: 3
replicas: 1
selector:
matchLabels:
app: sor-workers
app: sor-chat
template:
metadata:
labels:
app: sor-workers
app: sor-chat
spec:
imagePullSecrets:
- name: harbor-credentials
containers:
- name: sor-workers
- name: sor-chat
image: registry.aeternalisgames.com/sor/sor-server:latest
ports:
- containerPort: 8080
@@ -34,7 +34,7 @@ spec:
# Business-logic services only — no WebSocket, no auth gRPC.
# These pods subscribe to NATS and handle all game/store/social messages.
- name: ENABLED_SERVICES
value: "chat,collection,bazaar,content,versioning,matchmaking,game"
value: "chat"
# Postgres — all schemas (chat, collection, bazaar, catalog, game, identity).
- name: ConnectionStrings__Default
+9 -5
View File
@@ -1,14 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: sor-workers
name: nats
namespace: stone-server
spec:
selector:
app: sor-workers
app: nats
ports:
- name: http
- name: client
protocol: TCP
port: 80
targetPort: 8080
port: 4222
targetPort: 4222
- name: monitor
protocol: TCP
port: 8222
targetPort: 8222
type: ClusterIP