Add factorio game server

This commit is contained in:
SeanOMik 2023-04-19 19:37:53 -04:00
parent 983a15e982
commit ef95e10b97
Signed by: SeanOMik
GPG Key ID: 568F326C7EB33ACB
7 changed files with 110 additions and 0 deletions

View File

@ -0,0 +1,67 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: factorio
namespace: game-server
spec:
interval: 5m
chart:
spec:
chart: app-template
version: 1.3.x
sourceRef:
kind: HelmRepository
name: bjws-charts
namespace: flux-system
values:
image:
repository: factoriotools/factorio
tag: latest
service:
main:
ports:
http:
enabled: false
game:
enabled: true
primary: true
port: 34197
targetPort: 34197
protocol: UDP
probes:
liveness:
enabled: false
ingress:
main:
enabled: true
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: factorio
hosts:
- host: &host "fact.${SECRET_NEW_DOMAIN}"
paths:
- path: /
pathType: Prefix
service:
port:
name: game
persistence:
data:
enabled: true
type: hostPath
hostPath: /mnt/MainPool/Kubernetes/cdn
readOnly: true
mountPath: /data
config:
enabled: true
type: configMap
name: nginx-cdn-configmap
resources:
requests:
cpu: 1m

View File

@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helm-release.yaml

View File

@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./namespace.yaml
- ./network_policy.yaml
- ./factorio

View File

@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: game-servers
labels:
name: game-servers

View File

@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-most-allow-some
namespace: game-servers
spec:
# Apply to all pods in this namespace
podSelector: {}
ingress:
- from:
# Allow all pods in this namespace
- namespaceSelector:
matchLabels:
name: "game-servers"
# - podSelector: {}
# Allow traefik pods
- namespaceSelector:
matchLabels:
name: "traefik"
# Allow all pods with this label
- podSelector:
matchLabels:
needsGameServers: "yes"

View File

@ -10,4 +10,5 @@ resources:
- ./irc
- ./monitoring
- ./default
- ./game-servers
#- ./harbor

View File

@ -17,6 +17,7 @@ spec:
values:
additionalArguments:
- --api.insecure
- --entryPoints.factorio.address=:34197/udp
logs:
general: