Files
helm-charts/satisfactory/templates/satisfactory.sfs.yaml
jklein 5ff6e401c7 satisfactory: dev and server fall back instead of aborting (7.0.1)
--set dev=null aborted the render at .Values.dev.debug and --set server=null
at .Values.server.replicas, while the third block, game, has fallen back to
the chart defaults since 7.0.0. Half-safe is the worse state of the two:
whoever sees game=null work assumes server=null does too.

Both blocks now run through satisfactory.defaultedDict like game, via two new
helpers next to it. server.resources is deliberately NOT re-defaulted there -
it already runs through satisfactory.effectiveResources, which carries those
defaults and is null-safe on its own, and a second copy of limitFactor: 2 /
4Gi / 1 / 5Gi would be a third place for them to drift.

server is read in four files, not one, and the fourth is NOTES.txt, which
helm template never renders - a fix confined to the manifests would have
looked green and still aborted on a real helm install. All four go through
the helpers.

The single erased key was the quieter half of the bug and is fixed with it:
a nulled server.gamePort rendered "port:" and "nodePort:" empty into the
Service and an empty containerPort into the StatefulSet, and a nulled
server.storage a PVC asking for no size - manifests rejected by nothing until
the API server saw them. server.storage was documented in values.schema.json
as deliberately not null-safe; that reasoning does not survive the block-level
case, because it made "server: null" render a sizeless PVC instead of falling
back like everything else. The schema note is replaced rather than left lying.

Rendered output for valid values is unchanged: helm template against the
chart defaults and against a full override set is byte-identical to 7.0.0,
and so is NOTES.txt. Hence a patch bump, appVersion untouched.

Fixes #16
2026-09-23 20:45:24 +00:00

123 lines
5.4 KiB
YAML

{{- $game := fromYaml (include "satisfactory.game" .Values.game) -}}
{{- $dev := fromYaml (include "satisfactory.dev" .Values.dev) -}}
{{- $server := fromYaml (include "satisfactory.server" .Values.server) -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
serviceName: {{ .Release.Name }}-{{ .Chart.Name }}-service
replicas: {{ include "satisfactory.replicas" (dict "scaleDown" .Values.scaleDown "replicas" (include "satisfactory.formatNumber" $server.replicas)) }}
template:
metadata:
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
spec:
automountServiceAccountToken: false
securityContext:
{{- include "satisfactory.podSecurityContext" .Values.securityContext | nindent 8 }}
containers:
- name: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
image: "ghcr.io/wolveix/satisfactory-server:{{ .Chart.AppVersion }}"
env:
- name: DEBUG
value: "{{ $dev.debug }}"
- name: MAXPLAYERS
value: "{{ include "satisfactory.formatNumber" $game.maxPlayers }}"
# PUID/PGID are only used by the image's root entrypoint path;
# with the default non-root security context they are ignored.
- name: PGID
value: "1000"
- name: PUID
value: "1000"
- name: SKIPUPDATE
value: "false"
- name: STEAMBETA
value: "{{ $game.experimental }}"
# The image only knows the negative switch, so game.enableSeasonalEvents
# is negated here (#215): true -> "false" (events run).
- name: DISABLESEASONALEVENTS
value: "{{ include "satisfactory.disableSeasonalEvents" $game.enableSeasonalEvents }}"
- name: SERVERGAMEPORT
value: "{{ include "satisfactory.formatNumber" $server.gamePort }}"
- name: SERVERMESSAGINGPORT
value: "{{ include "satisfactory.formatNumber" $server.messagingPort }}"
{{- range $value := .Values.env }}
{{- if $value.value }}
- name: {{ $value.name }}
value: {{ tpl $value.value $ }}
{{- else if $value.valueFrom }}
{{- if $value.valueFrom.secretKeyRef }}
- name: {{ $value.name }}
valueFrom:
secretKeyRef:
name: {{ tpl $value.valueFrom.secretKeyRef.name $ }}
key: {{ tpl $value.valueFrom.secretKeyRef.key $ }}
{{- else if $value.valueFrom.configMapKeyRef }}
- name: {{ $value.name }}
valueFrom:
configMapKeyRef:
name: {{ tpl $value.valueFrom.configMapKeyRef.name $ }}
key: {{ tpl $value.valueFrom.configMapKeyRef.key $ }}
{{- end }}
{{- end }}
{{- end }}
ports:
- name: "api"
containerPort: {{ include "satisfactory.formatNumber" $server.gamePort }}
protocol: TCP
- name: "game"
containerPort: {{ include "satisfactory.formatNumber" $server.gamePort }}
protocol: UDP
- name: "messaging"
containerPort: {{ include "satisfactory.formatNumber" $server.messagingPort }}
protocol: TCP
livenessProbe:
{{- include "satisfactory.livenessProbe" .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{- include "satisfactory.readinessProbe" .Values.readinessProbe | nindent 12 }}
startupProbe:
{{- include "satisfactory.startupProbe" .Values.startupProbe | nindent 12 }}
resources:
{{- include "satisfactory.effectiveResources" $server.resources | nindent 12 }}
volumeMounts:
- name: satisfactory-volume
mountPath: /config
subPath: config/
- name: satisfactory-volume
mountPath: /config/gamefiles
subPath: gameFiles/
# Writable paths required by readOnlyRootFilesystem: the steam
# user's home dot-dirs (steamcmd bootstraps itself into
# ~/.local/share/Steam, keeps state under ~/.steam, and the game
# saves symlink lives under ~/.config) and /tmp (crash dumps).
# Everything else is written to the PVC at /config.
- name: steam-home
mountPath: /home/steam/.steam
subPath: dot-steam
- name: steam-home
mountPath: /home/steam/.config
subPath: dot-config
- name: steam-home
mountPath: /home/steam/.local
subPath: dot-local
- name: tmp
mountPath: /tmp
securityContext:
{{- include "satisfactory.containerSecurityContext" .Values.securityContext | nindent 12 }}
volumes:
- name: satisfactory-volume
persistentVolumeClaim:
# Deliberate exception from the naming scheme: renaming the PVC
# would detach existing data (see README, naming exceptions).
claimName: {{ .Release.Name }}-{{ .Chart.Name }}-vc
- name: steam-home
emptyDir: {}
- name: tmp
emptyDir: {}