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
84 lines
3.0 KiB
YAML
84 lines
3.0 KiB
YAML
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: {{ .Chart.Name }}-{{ .Release.Name }}-cwa-sfs
|
|
labels:
|
|
app: {{ .Chart.Name }}-{{ .Release.Name }}
|
|
spec:
|
|
serviceName: {{ .Chart.Name }}-{{ .Release.Name }}-cwa-service
|
|
replicas: {{ include "calibre-web-automated.replicas" (dict "scaleDown" .Values.scaleDown "replicas" .Values.cwa.replicas) }}
|
|
selector:
|
|
matchLabels:
|
|
app: {{ .Chart.Name }}-{{ .Release.Name }}-cwa-sfs
|
|
template:
|
|
metadata:
|
|
name: {{ .Chart.Name }}-{{ .Release.Name }}-cwa-sfs
|
|
labels:
|
|
app: {{ .Chart.Name }}-{{ .Release.Name }}-cwa-sfs
|
|
spec:
|
|
containers:
|
|
- name: {{ .Chart.Name }}-{{ .Release.Name }}-cwa-container
|
|
image: "ghcr.io/crocodilestick/calibre-web-automated:{{ .Chart.AppVersion }}"
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- containerPort: 8083
|
|
name: http
|
|
protocol: TCP
|
|
env:
|
|
- name: TZ
|
|
value: "{{ .Values.cwa.timezone }}"
|
|
- name: PUID
|
|
value: "1000"
|
|
- name: PGID
|
|
value: "1000"
|
|
- name: HARDCOVER_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Chart.Name }}-{{ .Release.Name }}-cwa-secret
|
|
key: hardcover-api-token
|
|
- name: CALIBRE_CONFIG_DIR
|
|
value: "/config/.config/calibre"
|
|
- name: NETWORK_SHARE_MODE
|
|
value: "false"
|
|
volumeMounts:
|
|
- mountPath: "/config"
|
|
name: cwa
|
|
subPath: config/
|
|
- mountPath: "/calibre-library"
|
|
name: cwa
|
|
subPath: calibre-library/
|
|
- mountPath: "/config/.config/calibre/plugins"
|
|
name: cwa
|
|
subPath: calibre-plugins/
|
|
- mountPath: "/config/.config/calibre/customize.py.json"
|
|
name: cwa-plugins-config
|
|
subPath: customize.py.json
|
|
- mountPath: "/cwa-book-ingest"
|
|
name: cwa-consume
|
|
livenessProbe:
|
|
{{- toYaml .Values.cwa.livenessProbe | nindent 12 }}
|
|
readinessProbe:
|
|
{{- toYaml .Values.cwa.readinessProbe | nindent 12 }}
|
|
startupProbe:
|
|
{{- toYaml .Values.cwa.startupProbe | nindent 12 }}
|
|
resources:
|
|
{{- include "calibre-web-automated.resources" .Values.cwa.resources | nindent 12 }}
|
|
automountServiceAccountToken: false
|
|
securityContext:
|
|
fsGroup: 1000
|
|
fsGroupChangePolicy: Always
|
|
restartPolicy: Always
|
|
volumes:
|
|
- name: cwa
|
|
persistentVolumeClaim:
|
|
claimName: {{ .Chart.Name }}-{{ .Release.Name }}-cwa-pvc
|
|
- name: cwa-consume
|
|
persistentVolumeClaim:
|
|
claimName: {{ .Chart.Name }}-{{ .Release.Name }}-cwa-consume-pvc
|
|
- name: cwa-plugins-config
|
|
secret:
|
|
secretName: {{ .Chart.Name }}-{{ .Release.Name }}-cwa-secret
|
|
items:
|
|
- key: calibre-plugins
|
|
path: customize.py.json
|
|
mode: 0644 |