Run Wekan with persistent FerretDB SQLite
This commit is contained in:
@@ -21,10 +21,12 @@ sent.
|
|||||||
|
|
||||||
## Storage
|
## Storage
|
||||||
|
|
||||||
WeKan uses its bundled FerretDB v1 with SQLite. Its database and uploads are stored
|
WeKan uses a separate FerretDB v1 container with SQLite. FerretDB's database is on
|
||||||
under `/data` on the `wekan-data` PVC (10Gi). The cluster's `local-path` StorageClass
|
the `ferretdb-data` PVC (5Gi); attachments and avatars are under `/data` on the
|
||||||
has a `Delete` reclaim policy; deleting this PVC permanently deletes the WeKan data.
|
`wekan-data` PVC (10Gi). NetworkPolicy only permits WeKan to reach FerretDB. Both
|
||||||
Keep independent backups for anything important.
|
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,
|
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;
|
boards, cards, or uploaded files. Its two PVCs are retained separately for rollback;
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -4,6 +4,9 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
- wekan-data-pvc.yaml
|
- wekan-data-pvc.yaml
|
||||||
|
- ferretdb-data-pvc.yaml
|
||||||
|
- ferretdb-deployment.yaml
|
||||||
|
- ferretdb-service.yaml
|
||||||
- wekan-deployment.yaml
|
- wekan-deployment.yaml
|
||||||
- wekan-service.yaml
|
- wekan-service.yaml
|
||||||
- wekan-ingress.yaml
|
- wekan-ingress.yaml
|
||||||
|
|||||||
@@ -20,3 +20,23 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
port: 8080
|
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
|
||||||
|
|||||||
@@ -24,6 +24,18 @@ spec:
|
|||||||
fsGroupChangePolicy: OnRootMismatch
|
fsGroupChangePolicy: OnRootMismatch
|
||||||
seccompProfile:
|
seccompProfile:
|
||||||
type: RuntimeDefault
|
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:
|
containers:
|
||||||
- name: wekan
|
- name: wekan
|
||||||
image: ghcr.io/wekan/wekan:v13.06
|
image: ghcr.io/wekan/wekan:v13.06
|
||||||
@@ -41,9 +53,15 @@ spec:
|
|||||||
- name: PORT
|
- name: PORT
|
||||||
value: "8080"
|
value: "8080"
|
||||||
- name: WEKAN_DB
|
- name: WEKAN_DB
|
||||||
value: ferretdb
|
value: mongodb
|
||||||
|
- name: MONGO_URL
|
||||||
|
value: mongodb://ferretdb:27017/wekan?directConnection=true
|
||||||
- name: WRITABLE_PATH
|
- name: WRITABLE_PATH
|
||||||
value: /data
|
value: /data
|
||||||
|
- name: METEOR_REACTIVITY_ORDER
|
||||||
|
value: polling
|
||||||
|
- name: DEFAULT_METEOR_REACTIVITY_ORDER
|
||||||
|
value: polling
|
||||||
- name: WITH_API
|
- name: WITH_API
|
||||||
value: "true"
|
value: "true"
|
||||||
- name: DDP_TRANSPORT
|
- name: DDP_TRANSPORT
|
||||||
|
|||||||
Reference in New Issue
Block a user