feat(multiplayer): deploy allocator role

This commit is contained in:
Josh Creek
2026-09-01 18:48:51 +01:00
parent 95e82cc719
commit 2e1c010fa2
6 changed files with 144 additions and 3 deletions
+61
View File
@@ -0,0 +1,61 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: allocator
namespace: cosmic-clash
labels:
app.kubernetes.io/name: allocator
app.kubernetes.io/component: allocator
spec:
replicas: 2
selector:
matchLabels:
app.kubernetes.io/name: allocator
template:
metadata:
labels:
app.kubernetes.io/name: allocator
app.kubernetes.io/component: allocator
spec:
serviceAccountName: allocator
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
seccompProfile:
type: RuntimeDefault
containers:
- name: allocator
image: ghcr.io/cosmic-clash/allocator@sha256:0000000000000000000000000000000000000000000000000000000000000000
args:
- --dsn=$(COSMIC_CLASH_POSTGRES_DSN)
- --agones-url=https://agones-allocator.agones-system.svc.cluster.local
- --agones-namespace=cosmic-clash
- --metrics-addr=:9091
ports:
- name: metrics
containerPort: 9091
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: [ALL]
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 1
memory: 512Mi
env:
- name: COSMIC_CLASH_POSTGRES_DSN
valueFrom:
secretKeyRef:
name: cosmic-clash-database
key: dsn
- name: COSMIC_CLASH_WORKLOAD_SECRET
valueFrom:
secretKeyRef:
name: cosmic-clash-workload
key: secret
+1
View File
@@ -7,6 +7,7 @@ resources:
- network-policies.yaml
- control-plane-deployment.yaml
- control-plane-service.yaml
- allocator-deployment.yaml
- allocator-service.yaml
- fleet.yaml
- fleet-autoscaler.yaml
+52
View File
@@ -97,3 +97,55 @@ spec:
podSelector:
matchLabels:
k8s-app: kube-dns
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allocator-allowed-flows
namespace: cosmic-clash
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: allocator
policyTypes: [Ingress, Egress]
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: monitoring
podSelector:
matchLabels:
app.kubernetes.io/name: prometheus
ports:
- protocol: TCP
port: 9091
egress:
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: data
podSelector:
matchLabels:
app.kubernetes.io/name: postgres
ports:
- protocol: TCP
port: 5432
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: agones-system
ports:
- protocol: TCP
port: 443
- 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 -1
View File
@@ -11,4 +11,10 @@ metadata:
name: match-server
namespace: cosmic-clash
automountServiceAccountToken: false
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: allocator
namespace: cosmic-clash
automountServiceAccountToken: false