This commit is contained in:
Sense T
2022-10-01 09:09:30 +00:00
parent 938db68be9
commit ffef0a5d92
19 changed files with 429 additions and 0 deletions

48
factorio/deployment.yaml Normal file
View File

@@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: factorio
spec:
selector:
matchLabels:
app: factorio
template:
metadata:
labels:
app: factorio
spec:
volumes:
- name: config
configMap:
name: factorio
- name: data
hostPath:
path: /data/factorio
containers:
- name: factorio
image: factoriotools/factorio
env:
- name: SAVE_NAME
value: server_krastorio_se
- name: LOAD_LATEST_SAVE
value: "false"
- name: GENERATE_NEW_SAVE
value: "false"
- name: CONFIG
value: /config
resources:
limits:
cpu: "2"
memory: "8Gi"
ports:
- containerPort: 34197
protocol: UDP
name: factorio
- containerPort: 27015
protocol: TCP
name: rcon
volumeMounts:
- mountPath: /factorio
name: data
- mountPath: /config
name: config

View File

@@ -0,0 +1,23 @@
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: game
resources:
- deployment.yaml
- services.yaml
configMapGenerator:
- name: factorio
files:
- config/rconpw
- config/server-adminlist.json
- config/server-banlist.json
- config/server-settings.json
- config/server-whitelist.json
- config/map-settings.json
- config/map-gen-settings.json
commonLabels:
app: factorio
images:
- name: factoriotools/factorio
newTag: 1.1.69

33
factorio/services.yaml Normal file
View File

@@ -0,0 +1,33 @@
kind: Service
apiVersion: v1
metadata:
name: factorio-game
spec:
selector:
app: factorio
type: LoadBalancer
ipFamilyPolicy: PreferDualStack
ipFamilies:
- IPv4
- IPv6
ports:
- port: 34197
protocol: UDP
targetPort: factorio
---
apiVersion: v1
kind: Service
metadata:
name: factorio-rcon
spec:
ipFamilyPolicy: PreferDualStack
ipFamilies:
- IPv4
- IPv6
selector:
app: factorio
ports:
- port: 27015
targetPort: rcon
protocol: TCP