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
120 lines
4.4 KiB
YAML
120 lines
4.4 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 "outline.replicas" (dict "scaleDown" .Values.scaleDown "replicas" .Values.outline.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: 1001
|
|
fsGroupChangePolicy: Always
|
|
containers:
|
|
- name: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
|
|
image: "outlinewiki/outline:{{ .Chart.AppVersion }}"
|
|
imagePullPolicy: IfNotPresent
|
|
env:
|
|
- name: PORT
|
|
value: "3000"
|
|
- name: URL
|
|
value: "https://{{ .Values.ingress.domain }}"
|
|
- name: SECRET_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-secret
|
|
key: outline-secret-key
|
|
- name: UTILS_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-secret
|
|
key: outline-utils-secret
|
|
- name: DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-db-secret
|
|
key: connection-url
|
|
- name: PGSSLMODE
|
|
value: disable
|
|
- name: REDIS_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-redis-secret
|
|
key: connection-url
|
|
- name: FILE_STORAGE
|
|
value: "local"
|
|
- name: FILE_STORAGE_LOCAL_ROOT_DIR
|
|
value: "/outline-data/data"
|
|
- name: OIDC_ISSUER_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-secret
|
|
key: discovery-url
|
|
- name: OIDC_CLIENT_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-secret
|
|
key: client-id
|
|
- name: OIDC_CLIENT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-secret
|
|
key: client-secret
|
|
- name: OIDC_DISPLAY_NAME
|
|
value: "{{ .Values.outline.oidc.displayName }}"
|
|
- name: FILE_STORAGE_UPLOAD_MAX_SIZE
|
|
value: "{{ .Values.outline.maxUploadSize }}"
|
|
- name: FORCE_HTTPS
|
|
value: "{{ .Values.outline.forceHttps }}"
|
|
ports:
|
|
- containerPort: 3000
|
|
protocol: TCP
|
|
name: http
|
|
# Outline exposes a dedicated health endpoint at /_health (also used
|
|
# by the upstream Docker HEALTHCHECK). It checks Postgres and Redis;
|
|
# there is no dependency-free HTTP endpoint ("/" returns 500 too when
|
|
# the database is down), so all three probes use /_health.
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /_health
|
|
port: 3000
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /_health
|
|
port: 3000
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
# The startup probe gates liveness/readiness. Outline runs database
|
|
# migrations on startup: budget 10s * 30 = 300s.
|
|
startupProbe:
|
|
httpGet:
|
|
path: /_health
|
|
port: 3000
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 30
|
|
resources:
|
|
{{- include "outline.resources" .Values.outline.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- mountPath: "/outline-data/data"
|
|
name: outline-data
|
|
subPath: data
|
|
restartPolicy: Always
|
|
volumes:
|
|
- name: outline-data
|
|
persistentVolumeClaim:
|
|
claimName: {{ .Release.Name }}-{{ .Chart.Name }}-pvc |