Files
helm-charts/patchmon/templates/patchmon-frontend.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

79 lines
2.8 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-frontend
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-frontend
spec:
replicas: {{ include "patchmon.replicas" (dict "scaleDown" .Values.scaleDown "replicas" .Values.patchmon.frontend.replicas) }}
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-frontend
template:
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-frontend
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-frontend
spec:
automountServiceAccountToken: false
securityContext:
{{- toYaml .Values.patchmon.frontend.securityContext.pod | nindent 8 }}
containers:
- name: {{ .Release.Name }}-{{ .Chart.Name }}-frontend
image: "ghcr.io/patchmon/patchmon-frontend:{{ .Chart.AppVersion }}"
imagePullPolicy: IfNotPresent
securityContext:
{{- toYaml .Values.patchmon.frontend.securityContext.container | nindent 12 }}
ports:
- containerPort: 3000
protocol: TCP
name: http
env:
- name: BACKEND_URL
value: "{{ .Release.Name }}-{{ .Chart.Name }}-backend-service"
- name: BACKEND_PORT
value: "80"
resources:
{{- include "patchmon.resources" .Values.patchmon.frontend.resources | nindent 12 }}
livenessProbe:
httpGet:
path: /
port: 3000
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /
port: 3000
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
# The startup probe gates liveness/readiness. Startup budget = 5s * 30 = 150s.
startupProbe:
httpGet:
path: /
port: 3000
periodSeconds: 5
timeoutSeconds: 5
failureThreshold: 30
volumeMounts:
- name: patchmon-volume
mountPath: /usr/share/nginx/html/assets
subPath: patchmon-assets
# nginx-unprivileged keeps its pid file and temp dirs in /tmp, and
# its entrypoint renders config templates into /etc/nginx/conf.d;
# both must be writable with a read-only root filesystem.
- name: tmp
mountPath: /tmp
- name: nginx-conf-d
mountPath: /etc/nginx/conf.d
restartPolicy: Always
volumes:
- name: tmp
emptyDir: {}
- name: nginx-conf-d
emptyDir: {}
- name: patchmon-volume
persistentVolumeClaim:
claimName: {{ .Release.Name }}-{{ .Chart.Name }}-pvc