Files
helm-charts/satisfactory/templates/satisfactory-server.sfs.yaml
T
jklein 6779e49355 Add per-workload replicas values and a chart-global scaleDown flag
Every Deployment/StatefulSet now takes its replica count from a replicas
value (default 1, explicit 0 allowed) via a new per-chart <chart>.replicas
helper; the helper uses a kindIs "invalid" nil check so an explicit 0 is
not swallowed by Helm's default function. A chart-global scaleDown flag
(default false) takes precedence: it renders every workload with
replicas: 0 and suspends the paperless-ngx consume CronJob, stopping the
app without uninstalling it (PVCs, Secrets, Services and Ingress remain).

Defaults leave the rendered manifests byte-identical to main, so all
published charts get a minor version bump; the template-chart carries the
reference helper implementation and stays unversioned.

Fixes #25
2026-08-22 08:12:40 +02:00

92 lines
3.2 KiB
YAML

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: "{{ .Release.Name }}-{{ .Chart.Name }}-sf-server"
spec:
selector:
matchLabels:
app: "{{ .Release.Name }}-{{ .Chart.Name }}-sf-server"
serviceName: "{{ .Release.Name }}-{{ .Chart.Name }}-sf-service"
replicas: {{ include "satisfactory.replicas" (dict "scaleDown" .Values.scaleDown "replicas" .Values.server.replicas) }}
template:
metadata:
labels:
app: "{{ .Release.Name }}-{{ .Chart.Name }}-sf-server"
spec:
automountServiceAccountToken: false
containers:
- name: "{{ .Release.Name }}-{{ .Chart.Name }}-sf-server"
image: "ghcr.io/wolveix/satisfactory-server:{{ .Chart.AppVersion }}"
env:
- name: DEBUG
value: "{{ .Values.dev.debug }}"
- name: MAXPLAYERS
value: "{{ .Values.game.maxPlayers }}"
- name: PGID
value: "1000"
- name: PUID
value: "1000"
- name: SKIPUPDATE
value: "false"
- name: STEAMBETA
value: "{{ .Values.game.experimental }}"
- name: DISABLESEASONALEVENTS
value: "{{ .Values.game.seasonalEvents }}"
- name: SERVERGAMEPORT
value: "{{ .Values.server.gamePort }}"
- name: SERVERMESSAGINGPORT
value: "{{ .Values.server.messagingPort }}"
ports:
- name: "api"
containerPort: {{ .Values.server.gamePort }}
protocol: TCP
- name: "game"
containerPort: {{ .Values.server.gamePort }}
protocol: UDP
- name: "messaging"
containerPort: {{ .Values.server.messagingPort }}
protocol: TCP
livenessProbe:
exec:
command:
- "/bin/sh"
- "-c"
- "/home/steam/healthcheck.sh"
failureThreshold: 4
successThreshold: 1
periodSeconds: 30
timeoutSeconds: 10
readinessProbe:
tcpSocket:
port: api
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
# The startup probe gates liveness/readiness. The server downloads /
# updates the game files via Steam on startup, which can take a long
# time: budget 30s * 40 = 20 minutes.
startupProbe:
exec:
command:
- "/bin/sh"
- "-c"
- "/home/steam/healthcheck.sh"
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 40
resources:
{{- include "satisfactory.resources" .Values.server.resources | nindent 12 }}
volumeMounts:
- name: satisfactory-volume
mountPath: /config
subPath: config/
- name: satisfactory-volume
mountPath: /config/gamefiles
subPath: gameFiles/
securityContext:
allowPrivilegeEscalation: false
volumes:
- name: satisfactory-volume
persistentVolumeClaim:
claimName: {{ .Release.Name }}-{{ .Chart.Name }}-vc