From c1519604433f102cecbfbc2d32317df90b8a8233 Mon Sep 17 00:00:00 2001 From: JJGadgets Date: Mon, 13 May 2024 20:21:33 +0800 Subject: [PATCH] fix(volsync/template): use ReadOnlyMany snapshotted PVCs allows CephFS to use shallow clone rather than full data clone --- kube/deploy/apps/immich/ks.yaml | 10 ++++++++++ kube/deploy/core/storage/volsync/template/rsrc-r2.yaml | 3 ++- .../deploy/core/storage/volsync/template/rsrc-rgw.yaml | 6 +++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/kube/deploy/apps/immich/ks.yaml b/kube/deploy/apps/immich/ks.yaml index 98c6fe76..1c06c49f 100644 --- a/kube/deploy/apps/immich/ks.yaml +++ b/kube/deploy/apps/immich/ks.yaml @@ -43,6 +43,16 @@ spec: ${APP_UID_IMMICH} RFSG: !!str | ${APP_UID_IMMICH} + patches: + - patch: | # too big for this luxury + $patch: delete + apiVersion: volsync.backube/v1alpha1 + kind: ReplicationSource + metadata: + name: immich-data-rgw-restic + target: + kind: ReplicationSource + name: immich-data-rgw-restic --- apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization diff --git a/kube/deploy/core/storage/volsync/template/rsrc-r2.yaml b/kube/deploy/core/storage/volsync/template/rsrc-r2.yaml index 1b99bb02..d606253d 100644 --- a/kube/deploy/core/storage/volsync/template/rsrc-r2.yaml +++ b/kube/deploy/core/storage/volsync/template/rsrc-r2.yaml @@ -13,6 +13,7 @@ spec: repository: "${PVC}-r2-restic" volumeSnapshotClassName: "${SNAP:=block}" storageClassName: "${SC:=block}" + accessModes: ["${SNAP_ACCESSMODE:=ReadOnlyMany}"] # CephFS shallow snapshot, and allow rsrc pod to schedule anywhere cacheStorageClassName: "${CACHE:=block}" cacheAccessModes: ["ReadWriteOnce"] cacheCapacity: "${CACHESIZE:=2Gi}" @@ -34,4 +35,4 @@ spec: memory: 256Mi limits: cpu: 500m - memory: 6Gi \ No newline at end of file + memory: 6Gi diff --git a/kube/deploy/core/storage/volsync/template/rsrc-rgw.yaml b/kube/deploy/core/storage/volsync/template/rsrc-rgw.yaml index 49d50e02..fa95005c 100644 --- a/kube/deploy/core/storage/volsync/template/rsrc-rgw.yaml +++ b/kube/deploy/core/storage/volsync/template/rsrc-rgw.yaml @@ -13,6 +13,7 @@ spec: repository: "vs-${PVC}-rgw-restic" volumeSnapshotClassName: "${SNAP:=block}" storageClassName: "${SC:=block}" + accessModes: ["${SNAP_ACCESSMODE:=ReadOnlyMany}"] # CephFS shallow snapshot, and allow rsrc pod to schedule anywhere cacheStorageClassName: "${CACHE:=block}" cacheAccessModes: ["ReadWriteOnce"] cacheCapacity: "${CACHESIZE:=2Gi}" @@ -30,8 +31,7 @@ spec: s3.home.arpa/store: "rgw-${CLUSTER_NAME}" moverResources: requests: - cpu: 100m memory: 256Mi limits: - cpu: 200m - memory: 6Gi \ No newline at end of file + cpu: 150m + memory: 6Gi