fix(thelounge): PVC & VolSync

This commit is contained in:
JJGadgets
2024-01-04 08:00:31 +08:00
parent bd26bcd880
commit a14ea29a96
6 changed files with 30 additions and 62 deletions

View File

@@ -23,11 +23,11 @@ stringData:
disableMediaPreview: false,
prefetchStorage: false,
fileUpload: {
enable: false,
maxFileSize: 10240,
baseUrl: null,
enable: true,
maxFileSize: -1,
baseUrl: "https://${APP_DNS_THELOUNGE_UPLOADS}/tinfoil/",
},
transports: ["polling", "websocket"],
transports: ["websocket", "polling"],
leaveMessage: "kthxbye",
defaults: {
name: "${APP_DNS_KAHIRC}",
@@ -43,7 +43,7 @@ stringData:
leaveMessage: "kthxbye",
},
lockNetwork: false,
messageStorage: ["sqlite", "text"],
messageStorage: ["sqlite"],
useHexIp: false,
webirc: null,
identd: {

View File

@@ -70,4 +70,5 @@ spec:
cpu: 10m
memory: 128Mi
limits:
memory: 6000Mi
cpu: 1000m
memory: 6000Mi

View File

@@ -1,17 +0,0 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: thelounge-data
namespace: &app thelounge
labels:
app.kubernetes.io/name: *app
app.kubernetes.io/instance: *app
snapshot.home.arpa/enabled: "true"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: block

View File

@@ -1,36 +0,0 @@
---
apiVersion: v1
kind: Secret
metadata:
name: thelounge-restic
namespace: thelounge
type: Opaque
stringData:
RESTIC_REPOSITORY: ${SECRET_VOLSYNC_R2_REPO}/thelounge
RESTIC_PASSWORD: ${SECRET_VOLSYNC_PASSWORD}
AWS_ACCESS_KEY_ID: ${SECRET_VOLSYNC_R2_ID}
AWS_SECRET_ACCESS_KEY: ${SECRET_VOLSYNC_R2_KEY}
---
apiVersion: volsync.backube/v1alpha1
kind: ReplicationSource
metadata:
name: thelounge-restic
namespace: thelounge
spec:
sourcePVC: thelounge-data
trigger:
schedule: "0 22 * * *" # 6am GMT+8
restic:
copyMethod: Snapshot
pruneIntervalDays: 14
repository: thelounge-restic
cacheCapacity: 2Gi
volumeSnapshotClassName: block
storageClassName: block
moverSecurityContext:
runAsUser: ${APP_UID_THELOUNGE}
runAsGroup: ${APP_UID_THELOUNGE}
fsGroup: ${APP_UID_THELOUNGE}
retain:
daily: 14
within: 7d

View File

@@ -7,5 +7,25 @@ metadata:
spec:
path: ./kube/deploy/apps/thelounge/app
dependsOn:
# - name: 1-core-storage-rook-ceph-cluster # TODO: re-add after fixing Rook ks.yaml, which needs Rook PVE ks.yaml name to be patched by master ks.yaml
- name: 1-core-ingress-nginx-app
- name: thelounge-pvc
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: thelounge-pvc
namespace: flux-system
spec:
path: ./kube/deploy/core/storage/volsync/template
targetNamespace: "thelounge"
dependsOn:
- name: 1-core-storage-volsync-app
- name: 1-core-storage-rook-ceph-cluster
postBuild:
substitute:
PVC: "thelounge-data"
SIZE: "10Gi"
SC: "file"
ACCESSMODE: "ReadWriteMany"
RUID: &uid "${APP_UID_THELOUNGE}"
RGID: *uid
RFSG: *uid

View File

@@ -6,7 +6,7 @@ metadata:
spec:
sourcePVC: "${PVC}"
trigger:
schedule: "0 */12 * * *" # 8am & 8pm GMT+8
schedule: "${CRON:=0 */12 * * *}" # 8am & 8pm GMT+8
restic:
copyMethod: "Snapshot"
pruneIntervalDays: ${PRUNE:=14}