Validate Helm Charts / Detect changed charts (pull_request) Successful in 4s
Validate Helm Charts / Resource quantities (pull_request) Successful in 12s
Validate Helm Charts / Build paperless-ngx (pull_request) Successful in 6s
Validate Helm Charts / Trivy config paperless-ngx (pull_request) Successful in 22s
Install-test / Install-test paperless-ngx (pull_request) Successful in 3m31s
Validate Helm Charts / Install-test (pull_request) Successful in 3m31s
Publish Helm Chart with patched Application Version / publish-helm-chart (push) Successful in 10s
Publish Paperless-NGX Helm Chart / Publish Paperless-NGX Helm Chart (push) Successful in 10s
SonarQube Analysis / SonarQube Analysis (push) Successful in 33s
paperless-ngx cannot run without a Redis - PAPERLESS_REDIS is the Celery broker - so every installation needed a second Helm release whose address lived in a 1Password item and in neither chart. This adds our own published valkey chart as an optional dependency, off by default and gated on valkeySubchart.enabled (not valkey.enabled, which the subchart's strict schema rejects and which Helm would only have complained about for whoever first switched it on). Additive, default behaviour unchanged: minor, 12.1.3+up3.2.1 -> 12.2.0+up3.2.1. Configured as a QUEUE (PVC + noeviction, the subchart's defaults), unlike stalwart's cache. Read off the 3.2.1 source rather than assumed: one PAPERLESS_REDIS url serves five consumers - the Celery broker, the result backend (Redis in 3.x, the database before), the channels pub/sub layer and two Django caches. allkeys-lru would not be a trade here but actively wrong, because LRU evicts typeless across the whole keyspace and a backlog of waiting consume tasks is exactly what it reads as cold; a dropped task is a document silently never processed. The price, named in values.yaml rather than smoothed over: two of the five consumers are caches, so a full instance refuses writes - new tasks included - and the answer is memory sizing, not a policy change. All three cache-like consumers are TTL-bounded, which is what keeps that price small. The password comes from the SAME item as the Redis connection, in a third field auth-conf holding the complete line "requirepass <password>". It cannot DEFAULT to secrets.redisSecretRef, and that is a property of Helm, not an omission: a values.yaml is never templated and a parent cannot compute a subchart's value. Measured - a template expression there lands verbatim in the subchart's itemPath and fails as a YAML parse error naming neither the value nor the cause. Forgetting it is therefore caught in values.schema.json, by a conditional rule rather than a fail() in a template. Also measured, and the reason: Helm renders a subchart's templates BEFORE the parent's, so a guard in this chart loses the race to the subchart's own required(), which reports "secrets.authSecretRef" and cannot know the path belongs to the redis item. A check that cannot fire is the mistake found while testing #77, so the first draft of that guard was removed rather than shipped. The schema runs before any rendering and names /valkey/secrets/authSecretRef. One trap found while testing and closed here: "valkeySubchart: null" DELETES the key, Helm then cannot resolve the condition path and treats the dependency as ENABLED - so erasing the switch turned the subchart on with no password set. Unlike every other block in this chart (issue #99), that one is rejected by the schema instead of defaulting. The install-test now runs with the subchart ON and the throwaway redis Deployment removed: the url in the fixtures names ci-valkey-service, so the bundled Valkey is the broker the release actually uses. #65 covered this path by a render only - deliberately, since an unused Valkey would have made that test look like it covered clustering. This is the first real installation of the valkey-subchart path. Documented, not glossed: the password now sits in that item twice and a rotation has to touch both fields; with the subchart on the vault url is a mandatory step, not a hint; and a OnePasswordItem materializes every field of its item, so both Secrets carry all three keys - untidy, harmless, and written down so nobody "tidies it up". Fixes #78
195 lines
5.8 KiB
YAML
195 lines
5.8 KiB
YAML
# Fixtures for the paperless-ngx install-test: a throwaway postgres, the
|
|
# secrets the 1Password operator would otherwise materialize (release name:
|
|
# ci), and storage plumbing. The chart hardcodes storageClassName
|
|
# "longhorn" (RWX for the consume PVC), which does not exist in k3d: a
|
|
# no-provisioner StorageClass named "longhorn" plus pre-bound hostPath PVs
|
|
# stand in for it. Paperless runs as uid 1000 with a read-only rootfs and
|
|
# hostPath volumes do not support fsGroup, so a node-setup Job pre-creates
|
|
# the exact subPath directories world-writable.
|
|
#
|
|
# THERE IS NO THROWAWAY REDIS HERE ANY MORE, and that is the change this file
|
|
# carries: the release brings its own Valkey through the subchart
|
|
# (ci/paperless-ngx/test-values.yaml says what that proves), so the broker under
|
|
# test is the chart's own object rather than a Deployment next to it. Leaving a
|
|
# redis Deployment in place would have been the worse of the two: the url would
|
|
# have had to name one of them, and whichever it named, the other would have sat
|
|
# there making the run look like it covered something it did not.
|
|
apiVersion: storage.k8s.io/v1
|
|
kind: StorageClass
|
|
metadata:
|
|
name: longhorn
|
|
provisioner: kubernetes.io/no-provisioner
|
|
---
|
|
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: node-setup
|
|
spec:
|
|
backoffLimit: 2
|
|
template:
|
|
spec:
|
|
restartPolicy: Never
|
|
containers:
|
|
- name: setup
|
|
image: public.ecr.aws/docker/library/busybox:1.36
|
|
command:
|
|
- sh
|
|
- -c
|
|
- >
|
|
mkdir -p /pv/paperless-ngx/data/data /pv/paperless-ngx/data/media
|
|
/pv/paperless-ngx/data/export /pv/paperless-ngx/consume &&
|
|
chmod -R 0777 /pv/paperless-ngx
|
|
volumeMounts:
|
|
- name: pv
|
|
mountPath: /pv
|
|
volumes:
|
|
- name: pv
|
|
hostPath:
|
|
path: /var/lib/ci-pv
|
|
type: DirectoryOrCreate
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolume
|
|
metadata:
|
|
name: ci-paperless-data
|
|
spec:
|
|
capacity:
|
|
storage: 20Gi
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
persistentVolumeReclaimPolicy: Retain
|
|
storageClassName: longhorn
|
|
claimRef:
|
|
namespace: default
|
|
name: ci-paperless-ngx-volume-claim
|
|
hostPath:
|
|
path: /var/lib/ci-pv/paperless-ngx/data
|
|
type: DirectoryOrCreate
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolume
|
|
metadata:
|
|
name: ci-paperless-consume
|
|
spec:
|
|
capacity:
|
|
storage: 1Gi
|
|
accessModes:
|
|
- ReadWriteMany
|
|
persistentVolumeReclaimPolicy: Retain
|
|
storageClassName: longhorn
|
|
claimRef:
|
|
namespace: default
|
|
name: ci-paperless-ngx-consume-volume-claim
|
|
hostPath:
|
|
path: /var/lib/ci-pv/paperless-ngx/consume
|
|
type: DirectoryOrCreate
|
|
---
|
|
# The two Secrets below stand in for ONE 1Password item. Both the chart's
|
|
# redis OnePasswordItem and the subchart's auth OnePasswordItem point at
|
|
# op://ci/paperless-redis, and a OnePasswordItem materializes EVERY field of the
|
|
# item it names - so in a real cluster both Secrets carry all three fields. They
|
|
# are written out that way here rather than trimmed to what each consumer reads,
|
|
# because the trimmed version would have been a fixture that is tidier than
|
|
# reality and would have hidden the only thing worth knowing: the extra keys are
|
|
# unused, not a leak and not a bug.
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: ci-paperless-ngx-redis-secret
|
|
stringData:
|
|
# Names the SUBCHART's Service, which is the mandatory vault step of this
|
|
# configuration (NOTES.txt prints it). A wrong name here is the failure this
|
|
# install-test exists to catch: paperless would come up healthy and process
|
|
# nothing.
|
|
redis-connection-url: redis://:cipass@ci-valkey-service:6379
|
|
key-prefix: ci
|
|
# Same password as in the url above - that duplication is the chart's
|
|
# documented trap 1, and the fixture is the cheapest place to keep it honest:
|
|
# let the two drift and the run goes red on authentication.
|
|
auth-conf: requirepass cipass
|
|
---
|
|
# What the subchart's own OnePasswordItem (ci-valkey-secret) would become. The
|
|
# key the Valkey actually mounts is "auth-conf", and its value has to be a
|
|
# COMPLETE configuration line, because the Valkey configuration includes the
|
|
# file: give it anything that is not "requirepass <password>" and the init
|
|
# container refuses to start the pod, which is the failure that chart exists to
|
|
# make loud.
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: ci-valkey-secret
|
|
stringData:
|
|
auth-conf: requirepass cipass
|
|
redis-connection-url: redis://:cipass@ci-valkey-service:6379
|
|
key-prefix: ci
|
|
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: ci-paperless-ngx-db-secret
|
|
stringData:
|
|
server: postgres
|
|
port: "5432"
|
|
database: paperless
|
|
username: ci
|
|
password: ci
|
|
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: ci-paperless-ngx-secret
|
|
stringData:
|
|
username: admin
|
|
password: ci-admin-password
|
|
paperless-secret-key: paperless-ci-secret-key-0123456789abcdef0123456789abcdef
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: postgres
|
|
labels:
|
|
app: postgres
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: postgres
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: postgres
|
|
spec:
|
|
containers:
|
|
- name: postgres
|
|
image: public.ecr.aws/docker/library/postgres:16-alpine
|
|
env:
|
|
- name: POSTGRES_USER
|
|
value: ci
|
|
- name: POSTGRES_PASSWORD
|
|
value: ci
|
|
- name: POSTGRES_DB
|
|
value: paperless
|
|
ports:
|
|
- containerPort: 5432
|
|
readinessProbe:
|
|
exec:
|
|
command: ["pg_isready", "-U", "ci"]
|
|
periodSeconds: 5
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /var/lib/postgresql/data
|
|
volumes:
|
|
- name: data
|
|
emptyDir: {}
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: postgres
|
|
spec:
|
|
selector:
|
|
app: postgres
|
|
ports:
|
|
- port: 5432
|
|
targetPort: 5432
|