fix(multiplayer): deploy reconnect abandonment maintenance

This commit is contained in:
Josh Creek
2026-09-03 21:05:58 +01:00
parent a4de140424
commit bcc2639a33
8 changed files with 155 additions and 2 deletions
+1
View File
@@ -11,6 +11,7 @@ resources:
- allocator-deployment.yaml
- allocator-service.yaml
- allocator-pdb.yaml
- maintenance-deployment.yaml
- fleet.yaml
- fleet-autoscaler.yaml
- game-server-pdb.yaml
@@ -0,0 +1,59 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: maintenance
namespace: cosmic-clash
labels:
app.kubernetes.io/name: maintenance
app.kubernetes.io/component: maintenance
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: maintenance
template:
metadata:
labels:
app.kubernetes.io/name: maintenance
app.kubernetes.io/component: maintenance
spec:
terminationGracePeriodSeconds: 10
serviceAccountName: maintenance
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
seccompProfile:
type: RuntimeDefault
containers:
- name: maintenance
image: ghcr.io/cosmic-clash/maintenance@sha256:0000000000000000000000000000000000000000000000000000000000000000
args:
- --dsn=$(COSMIC_CLASH_POSTGRES_DSN)
- --interval=1m
- --initial-connect-interval=1s
- --batch=100
- --stalled-allocation-batch=100
- --initial-connect-batch=100
- --live-abandonment-batch=100
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: [ALL]
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 250m
memory: 256Mi
env:
- name: COSMIC_CLASH_POSTGRES_DSN
valueFrom:
secretKeyRef:
name: cosmic-clash-database
key: dsn
+34
View File
@@ -141,3 +141,37 @@ spec:
podSelector:
matchLabels:
k8s-app: kube-dns
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: maintenance-allowed-egress
namespace: cosmic-clash
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: maintenance
policyTypes: [Egress]
egress:
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: data
podSelector:
matchLabels:
app.kubernetes.io/name: postgres
ports:
- protocol: TCP
port: 5432
- ports:
- protocol: UDP
port: 53
- protocol: TCP
port: 53
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
podSelector:
matchLabels:
k8s-app: kube-dns
+7
View File
@@ -18,3 +18,10 @@ metadata:
name: allocator
namespace: cosmic-clash
automountServiceAccountToken: false
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: maintenance
namespace: cosmic-clash
automountServiceAccountToken: false