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
74 lines
2.3 KiB
YAML
74 lines
2.3 KiB
YAML
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: {{ .Release.Name }}-server-sfs
|
|
labels:
|
|
app: {{ .Release.Name }}
|
|
spec:
|
|
replicas: {{ include "teamspeak-server.replicas" (dict "scaleDown" .Values.scaleDown "replicas" .Values.replicas) }}
|
|
selector:
|
|
matchLabels:
|
|
app: {{ .Release.Name }}-server-sfs
|
|
template:
|
|
metadata:
|
|
name: {{ .Release.Name }}-server-sfs
|
|
labels:
|
|
app: {{ .Release.Name }}-server-sfs
|
|
spec:
|
|
automountServiceAccountToken: false
|
|
containers:
|
|
- name: {{ .Release.Name }}-ts-server-container
|
|
image: "teamspeaksystems/teamspeak6-server:{{ .Chart.AppVersion }}"
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- name: voice-port
|
|
containerPort: 30987
|
|
protocol: UDP
|
|
- name: file-transfer
|
|
containerPort: 30033
|
|
protocol: TCP
|
|
- name: web-query
|
|
containerPort: 10080
|
|
protocol: TCP
|
|
env:
|
|
- name: TSSERVER_LICENSE_ACCEPTED
|
|
value: "accept"
|
|
- name: TSSERVER_DEFAULT_PORT
|
|
value: "30987"
|
|
# The voice service is UDP and cannot be probed; probe the TCP
|
|
# file-transfer port instead.
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: file-transfer
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: file-transfer
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
# The startup probe gates liveness/readiness. Startup budget = 5s * 30 = 150s.
|
|
startupProbe:
|
|
tcpSocket:
|
|
port: file-transfer
|
|
periodSeconds: 5
|
|
timeoutSeconds: 5
|
|
failureThreshold: 30
|
|
resources:
|
|
{{- include "teamspeak-server.resources" .Values.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- name: "teamspeak-volume"
|
|
mountPath: /var/tsserver/
|
|
restartPolicy: Always
|
|
securityContext:
|
|
fsGroup: 9987
|
|
volumes:
|
|
- name: "teamspeak-volume"
|
|
persistentVolumeClaim:
|
|
claimName: {{ .Release.Name }}-teamspeak-volume-claim
|
|
serviceName: {{ .Release.Name }}-service
|
|
|
|
|