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

74 lines
2.6 KiB
YAML

{{- if .Values.matrix.delegation.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
spec:
replicas: {{ include "matrix-synapse.replicas" (dict "scaleDown" .Values.scaleDown "replicas" .Values.matrix.delegation.replicas) }}
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
template:
metadata:
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
spec:
automountServiceAccountToken: false
securityContext:
{{- toYaml .Values.matrix.delegation.securityContext.pod | nindent 8 }}
containers:
- name: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
image: "nginx:1.28.3"
securityContext:
{{- toYaml .Values.matrix.delegation.securityContext.container | nindent 12 }}
ports:
- containerPort: 8080
name: http
volumeMounts:
- name: nginx-config
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
# The mounted nginx.conf points the pid file and all temp paths to
# /tmp, so a single writable emptyDir suffices with a read-only
# root filesystem.
- name: tmp
mountPath: /tmp
resources:
{{- include "matrix-synapse.resources" .Values.matrix.delegation.resources | nindent 12 }}
readinessProbe:
httpGet:
path: /.well-known/matrix/server
port: http
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
livenessProbe:
httpGet:
path: /.well-known/matrix/server
port: http
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
# The startup probe gates liveness/readiness. Startup budget = 5s * 30 = 150s.
startupProbe:
httpGet:
path: /.well-known/matrix/server
port: http
scheme: HTTP
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 30
volumes:
- name: tmp
emptyDir: {}
- name: nginx-config
configMap:
name: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx-config
items:
- key: nginx.conf
path: nginx.conf
{{- end }}