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
71 lines
2.6 KiB
YAML
71 lines
2.6 KiB
YAML
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: "{{ .Release.Name }}-{{ .Chart.Name }}-sfs"
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: "{{ .Release.Name }}-{{ .Chart.Name }}-sfs"
|
|
serviceName: "{{ .Release.Name }}-{{ .Chart.Name }}-service"
|
|
replicas: {{ include "zipline.replicas" (dict "scaleDown" .Values.scaleDown "replicas" .Values.zipline.replicas) }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: "{{ .Release.Name }}-{{ .Chart.Name }}-sfs"
|
|
spec:
|
|
securityContext:
|
|
{{- toYaml .Values.zipline.securityContext.pod | nindent 8 }}
|
|
containers:
|
|
- name: "{{ .Release.Name }}-{{ .Chart.Name }}-sfs"
|
|
image: "ghcr.io/diced/zipline:{{ .Chart.AppVersion }}"
|
|
securityContext:
|
|
{{- toYaml .Values.zipline.securityContext.container | nindent 12 }}
|
|
env:
|
|
- name: DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-db-secret
|
|
key: connection-url
|
|
- name: CORE_DEFAULT_DOMAIN
|
|
value: "{{ .Values.config.domain }}"
|
|
- name: CORE_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-core-secret
|
|
key: server-secret
|
|
- name: UPLOADER_ADMIN_LIMIT
|
|
value: 500mb
|
|
resources:
|
|
{{- include "zipline.resources" .Values.zipline.resources | nindent 12 }}
|
|
ports:
|
|
- name: "zipline-server"
|
|
containerPort: 3000
|
|
protocol: TCP
|
|
livenessProbe:
|
|
{{- toYaml .Values.zipline.livenessProbe | nindent 12 }}
|
|
readinessProbe:
|
|
{{- toYaml .Values.zipline.readinessProbe | nindent 12 }}
|
|
startupProbe:
|
|
{{- toYaml .Values.zipline.startupProbe | nindent 12 }}
|
|
volumeMounts:
|
|
- name: zipline-volume
|
|
mountPath: /zipline/uploads
|
|
subPath: uploads/
|
|
- name: zipline-volume
|
|
mountPath: /zipline/public
|
|
subPath: public/
|
|
- name: zipline-volume
|
|
mountPath: /zipline/themes
|
|
subPath: themes/
|
|
# Zipline writes temporary chunks/files below /tmp; with a
|
|
# read-only root filesystem this must be a writable emptyDir.
|
|
- name: tmp
|
|
mountPath: /tmp
|
|
automountServiceAccountToken: false
|
|
volumes:
|
|
- name: tmp
|
|
emptyDir: {}
|
|
- name: zipline-volume
|
|
persistentVolumeClaim:
|
|
claimName: {{ .Release.Name }}-{{ .Chart.Name }}-vc
|