Run Wekan with persistent FerretDB SQLite

This commit is contained in:
funman300
2026-11-11 20:24:08 -07:00
parent 59ae43cc28
commit eae9efff9f
7 changed files with 151 additions and 5 deletions
+6 -4
View File
@@ -21,10 +21,12 @@ sent.
## Storage
WeKan uses its bundled FerretDB v1 with SQLite. Its database and uploads are stored
under `/data` on the `wekan-data` PVC (10Gi). The cluster's `local-path` StorageClass
has a `Delete` reclaim policy; deleting this PVC permanently deletes the WeKan data.
Keep independent backups for anything important.
WeKan uses a separate FerretDB v1 container with SQLite. FerretDB's database is on
the `ferretdb-data` PVC (5Gi); attachments and avatars are under `/data` on the
`wekan-data` PVC (10Gi). NetworkPolicy only permits WeKan to reach FerretDB. Both
claims use the cluster's `local-path` StorageClass with a `Delete` reclaim policy;
deleting either permanently deletes its data. Keep independent backups for anything
important.
The former Planka database was checked before replacement and contained no projects,
boards, cards, or uploaded files. Its two PVCs are retained separately for rollback;
+13
View File
@@ -0,0 +1,13 @@
# FerretDB's SQLite database and state directory.
# local-path has reclaimPolicy: Delete; deleting this PVC deletes the database.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ferretdb-data
namespace: wedding-planner
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
+78
View File
@@ -0,0 +1,78 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ferretdb
namespace: wedding-planner
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: ferretdb
template:
metadata:
labels:
app: ferretdb
spec:
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
fsGroupChangePolicy: OnRootMismatch
seccompProfile:
type: RuntimeDefault
containers:
- name: ferretdb
image: ghcr.io/wekan/ferretdb-sqlite:v1.107.0
ports:
- name: mongodb
containerPort: 27017
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
env:
- name: FERRETDB_HANDLER
value: sqlite
- name: FERRETDB_SQLITE_URL
value: file:/state/
- name: FERRETDB_LISTEN_ADDR
value: 0.0.0.0:27017
- name: FERRETDB_STATE_DIR
value: /state
- name: FERRETDB_TELEMETRY
value: disable
- name: FERRETDB_LOG_LEVEL
value: error
- name: GODEBUG
value: multipathtcp=0
volumeMounts:
- name: state
mountPath: /state
startupProbe:
tcpSocket:
port: mongodb
failureThreshold: 60
periodSeconds: 5
readinessProbe:
tcpSocket:
port: mongodb
periodSeconds: 10
livenessProbe:
tcpSocket:
port: mongodb
periodSeconds: 20
resources:
requests:
cpu: 50m
memory: 96Mi
limits:
cpu: 500m
memory: 384Mi
volumes:
- name: state
persistentVolumeClaim:
claimName: ferretdb-data
+12
View File
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: ferretdb
namespace: wedding-planner
spec:
selector:
app: ferretdb
ports:
- name: mongodb
port: 27017
targetPort: mongodb
+3
View File
@@ -4,6 +4,9 @@ kind: Kustomization
resources:
- namespace.yaml
- wekan-data-pvc.yaml
- ferretdb-data-pvc.yaml
- ferretdb-deployment.yaml
- ferretdb-service.yaml
- wekan-deployment.yaml
- wekan-service.yaml
- wekan-ingress.yaml
+20
View File
@@ -20,3 +20,23 @@ spec:
ports:
- protocol: TCP
port: 8080
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: ferretdb-ingress
namespace: wedding-planner
spec:
podSelector:
matchLabels:
app: ferretdb
policyTypes:
- Ingress
ingress:
- from:
- podSelector:
matchLabels:
app: wekan
ports:
- protocol: TCP
port: 27017
+19 -1
View File
@@ -24,6 +24,18 @@ spec:
fsGroupChangePolicy: OnRootMismatch
seccompProfile:
type: RuntimeDefault
initContainers:
- name: wait-for-ferretdb
image: ghcr.io/wekan/wekan:v13.06
command:
- bash
- -ec
- until (echo > /dev/tcp/ferretdb/27017) >/dev/null 2>&1; do sleep 2; done
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
containers:
- name: wekan
image: ghcr.io/wekan/wekan:v13.06
@@ -41,9 +53,15 @@ spec:
- name: PORT
value: "8080"
- name: WEKAN_DB
value: ferretdb
value: mongodb
- name: MONGO_URL
value: mongodb://ferretdb:27017/wekan?directConnection=true
- name: WRITABLE_PATH
value: /data
- name: METEOR_REACTIVITY_ORDER
value: polling
- name: DEFAULT_METEOR_REACTIVITY_ORDER
value: polling
- name: WITH_API
value: "true"
- name: DDP_TRANSPORT