Files
helm-charts/matrix-synapse/templates/matrix-synapse.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

89 lines
3.0 KiB
YAML

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
spec:
serviceName: {{ .Release.Name }}-{{ .Chart.Name }}-service
replicas: {{ include "matrix-synapse.replicas" (dict "scaleDown" .Values.scaleDown "replicas" .Values.matrix.replicas) }}
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
template:
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
spec:
automountServiceAccountToken: false
securityContext:
fsGroup: 1000
fsGroupChangePolicy: Always
containers:
- name: "{{ .Release.Name }}-{{ .Chart.Name }}-container"
image: "ghcr.io/element-hq/synapse:{{ .Chart.AppVersion }}"
env:
- name: SYNAPSE_SERVER_NAME
value: "{{ required "You must provide a Server-Name" .Values.matrix.serverName }}"
- name: SYNAPSE_REPORT_STATS
value: "no"
- name: UID
value: "1000"
- name: GID
value: "1000"
- name: TZ
value: "{{ .Values.matrix.timezone }}"
ports:
- name: http
containerPort: 8008
protocol: TCP
readinessProbe:
httpGet:
path: /health
port: http
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
path: /health
port: http
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
# The startup probe gates liveness/readiness. Synapse can take a
# while to start (migrations, cache warmup): budget 10s * 30 = 300s.
startupProbe:
httpGet:
path: /health
port: http
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
resources:
{{- include "matrix-synapse.resources" .Values.matrix.resources | nindent 12 }}
volumeMounts:
- name: matrix-synapse-volume
mountPath: /data
subPath: matrix-synapse-data/
- name: matrix-synapse-volume
mountPath: /media_store
subPath: matrix-media-store/
- name: matrix-synapse-config-secret
mountPath: /data/homeserver.yaml
subPath: homeserver.yaml
volumes:
- name: matrix-synapse-volume
persistentVolumeClaim:
claimName: {{ .Release.Name }}-{{ .Chart.Name }}-pvc
- name: matrix-synapse-config-secret
secret:
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-config-secret
items:
- key: homeserver.yaml
path: homeserver.yaml