mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
feat(multiplayer): deploy allocator role
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user