From 3622887a3e466e2e27c569392bd33484e2210bab Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Fri, 7 Feb 2025 15:11:43 +0100 Subject: [PATCH] Single container --- backups/base/backup-cronjob.yaml | 19 +------------------ .../overlays/test/xrootd/backup-cronjob.yaml | 6 ++---- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/backups/base/backup-cronjob.yaml b/backups/base/backup-cronjob.yaml index 8493800..dbfbd6a 100644 --- a/backups/base/backup-cronjob.yaml +++ b/backups/base/backup-cronjob.yaml @@ -8,15 +8,12 @@ spec: spec: template: spec: - volumes: - - name: backup-storage - emptyDir: {} restartPolicy: Never containers: - name: backup-container image: docker.sunet.se/drive/duplicity:bookworm-slim-1 command: ["bash"] - args: ["-c", "duplicity /backup_storage rclone://destination:$(BUCKET) --no-encryption --full-if-older-than 1M; umount /backup_storage" ] + args: ["-c", "mkdir /backup_storage; rclone mount --daemon source:$(SOURCE_BUCKET) /backup_storage; duplicity /backup_storage rclone://destination:$(DESTINATION_BUCKET) --no-encryption --full-if-older-than 1M; umount /backup_storage"] env: - name: RCLONE_CONFIG_DESTINATION_ACL value: private @@ -26,16 +23,6 @@ spec: value: s3.sto3.safedc.net - name: RCLONE_CONFIG_DESTINATION_PROVIDER value: Ceph - volumeMounts: - - name: backup-storage - mountPath: /backup_storage - mountPropagation: HostToContainer - - name: mount-container - image: rclone/rclone:1.69.0 - args: ["mount", "--allow-non-empty", "source:$(BUCKET)", "/backup_storage"] - securityContext: - privileged: true - env: - name: RCLONE_CONFIG_SOURCE_ACL value: private - name: RCLONE_CONFIG_SOURCE_TYPE @@ -44,7 +31,3 @@ spec: value: s3.sto4.safedc.net - name: RCLONE_CONFIG_SOURCE_PROVIDER value: Ceph - volumeMounts: - - name: backup-storage - mountPath: /backup_storage - mountPropagation: Bidirectional diff --git a/backups/overlays/test/xrootd/backup-cronjob.yaml b/backups/overlays/test/xrootd/backup-cronjob.yaml index 477cf23..f05d93c 100644 --- a/backups/overlays/test/xrootd/backup-cronjob.yaml +++ b/backups/overlays/test/xrootd/backup-cronjob.yaml @@ -12,7 +12,7 @@ spec: containers: - name: backup-container env: - - name: BUCKET + - name: DESTINATION_BUCKET value: "xrootd-test-mirror" - name: RCLONE_CONFIG_DESTINATION_ACCESS_KEY_ID valueFrom: @@ -24,9 +24,7 @@ spec: secretKeyRef: name: xrootd-secret key: "destination-secret-access-key" - - name: mount-container - env: - - name: BUCKET + - name: SOURCE_BUCKET value: "xrootd-test" - name: RCLONE_CONFIG_SOURCE_ACCESS_KEY_ID valueFrom: