Skip to content

Instantly share code, notes, and snippets.

@akazakou
Created December 2, 2021 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akazakou/1fde4aae5289535713f1b74bff059d4c to your computer and use it in GitHub Desktop.
Save akazakou/1fde4aae5289535713f1b74bff059d4c to your computer and use it in GitHub Desktop.
Kuberneted Deployment for the Satisfactory Experemental Dedicated Server
---
apiVersion: v1
kind: Namespace
metadata:
name: satisfactory
labels:
istio-injection: enabled
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: satisfactory
namespace: satisfactory
labels:
type: local
spec:
storageClassName: manual
persistentVolumeReclaimPolicy: Retain
capacity:
storage: 100Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/satisfactory"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: satisfactory-claim
namespace: satisfactory
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: satisfactory
namespace: satisfactory
labels:
app.kubernetes.io/name: satisfactory
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: satisfactory
template:
metadata:
namespace: satisfactory
labels:
app.kubernetes.io/name: satisfactory
spec:
terminationGracePeriodSeconds: 60
serviceAccountName: satisfactory
imagePullSecrets:
- name: github-pull-images-secret
securityContext:
{}
volumes:
- name: satisfactory-claim
persistentVolumeClaim:
claimName: satisfactory-claim
containers:
- name: satisfactory
securityContext:
{}
image: "wolveix/satisfactory-server:latest"
imagePullPolicy: Always
ports:
- name: game
containerPort: 32001
protocol: UDP
- name: beacon
containerPort: 32000
protocol: UDP
- name: query
containerPort: 32002
protocol: UDP
# livenessProbe:
# tcpSocket:
# port: 32001
# initialDelaySeconds: 300
# periodSeconds: 10
env:
- name: MAXPLAYERS
value: "64"
- name: PGID
value: "1000"
- name: PUID
value: "1000"
- name: STEAMBETA
value: "true"
- name: CRASHREPORT
value: "true"
- name: SERVERBEACONPORT
value: "32000"
- name: SERVERGAMEPORT
value: "32001"
- name: SERVERQUERYPORT
value: "32002"
volumeMounts:
- mountPath: "/config"
name: satisfactory-claim
resources:
limits:
cpu: 6000m
memory: 48Gi
requests:
cpu: 500m
memory: 8Gi
---
apiVersion: v1
kind: Service
metadata:
name: satisfactory
namespace: satisfactory
labels:
app.kubernetes.io/name: satisfactory
spec:
type: NodePort
ports:
- port: 32001
nodePort: 32001
targetPort: game
protocol: UDP
name: game
- port: 32000
nodePort: 32000
targetPort: beacon
protocol: UDP
name: beacon
- port: 32002
nodePort: 32002
targetPort: query
protocol: UDP
name: query
selector:
app.kubernetes.io/name: satisfactory
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: satisfactory
namespace: satisfactory
labels:
app.kubernetes.io/name: satisfactory
---
# Below required only for the experimental satisfactory to apply the latest updates
kind: ServiceAccount
apiVersion: v1
metadata:
name: deployment-restart
namespace: satisfactory
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: deployment-restart
namespace: satisfactory
rules:
- apiGroups: ["apps", "extensions"]
resources: ["deployments"]
resourceNames: ["satisfactory"]
verbs: ["get", "patch", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: deployment-restart
namespace: satisfactory
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: deployment-restart
subjects:
- kind: ServiceAccount
name: deployment-restart
namespace: satisfactory
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: deployment-restart
namespace: satisfactory
spec:
concurrencyPolicy: Forbid
schedule: '0 5 * * *'
jobTemplate:
spec:
backoffLimit: 2
activeDeadlineSeconds: 600
template:
metadata:
annotations:
sidecar.istio.io/inject: "false"
spec:
serviceAccountName: deployment-restart
restartPolicy: Never
containers:
- name: kubectl
image: bitnami/kubectl
command:
- 'kubectl'
- 'rollout'
- 'restart'
- 'deployment/satisfactory'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment