feat: backup improvements — AlbyHub Restic, Gitea dump CronJob, Immich → MinIO #17
@@ -19,23 +19,76 @@ spec:
|
|||||||
key: "dd0de40c-9ad6-4034-9d5c-b311016ebf19"
|
key: "dd0de40c-9ad6-4034-9d5c-b311016ebf19"
|
||||||
property: apikey
|
property: apikey
|
||||||
---
|
---
|
||||||
|
apiVersion: external-secrets.io/v1
|
||||||
|
kind: ExternalSecret
|
||||||
|
metadata:
|
||||||
|
name: immich-minio-creds
|
||||||
|
spec:
|
||||||
|
target:
|
||||||
|
name: immich-minio-creds
|
||||||
|
deletionPolicy: Delete
|
||||||
|
template:
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
access-key: "{{ .minio_key }}"
|
||||||
|
secret-key: "{{ .minio_secret }}"
|
||||||
|
rclone.conf: |
|
||||||
|
[nas1minio]
|
||||||
|
type = s3
|
||||||
|
provider = Minio
|
||||||
|
endpoint = http://nas1.shire-zebra.ts.net:9000
|
||||||
|
access_key_id = {{ .minio_key }}
|
||||||
|
secret_access_key = {{ .minio_secret }}
|
||||||
|
region = us-east-1
|
||||||
|
secretStoreRef:
|
||||||
|
name: bitwarden-login
|
||||||
|
kind: ClusterSecretStore
|
||||||
|
data:
|
||||||
|
- secretKey: minio_key
|
||||||
|
remoteRef:
|
||||||
|
key: dcbcf704-7dce-48d7-bbd1-b3a801875b3d
|
||||||
|
property: username
|
||||||
|
- secretKey: minio_secret
|
||||||
|
remoteRef:
|
||||||
|
key: dcbcf704-7dce-48d7-bbd1-b3a801875b3d
|
||||||
|
property: password
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: immich-backup-staging
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: longhorn-default
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 400Gi
|
||||||
|
---
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: CronJob
|
kind: CronJob
|
||||||
metadata:
|
metadata:
|
||||||
name: backup
|
name: backup
|
||||||
spec:
|
spec:
|
||||||
schedule: "0 4 * * *" # At 4am each day
|
schedule: "0 4 * * *" # At 4am each day
|
||||||
|
successfulJobsHistoryLimit: 3
|
||||||
|
failedJobsHistoryLimit: 3
|
||||||
jobTemplate:
|
jobTemplate:
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
spec:
|
spec:
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
volumes:
|
volumes:
|
||||||
- name: nas1
|
- name: staging
|
||||||
nfs:
|
persistentVolumeClaim:
|
||||||
path: /mnt/all/backups/immich
|
claimName: immich-backup-staging
|
||||||
server: nas1.shire-zebra.ts.net
|
- name: rclone-config
|
||||||
containers:
|
secret:
|
||||||
|
secretName: immich-minio-creds
|
||||||
|
items:
|
||||||
|
- key: rclone.conf
|
||||||
|
path: rclone.conf
|
||||||
|
initContainers:
|
||||||
- name: immich-go
|
- name: immich-go
|
||||||
image: "src.thehellings.com/greg/immich:latest"
|
image: "src.thehellings.com/greg/immich:latest"
|
||||||
imagePullPolicy: "Always"
|
imagePullPolicy: "Always"
|
||||||
@@ -46,18 +99,38 @@ spec:
|
|||||||
immich-go
|
immich-go
|
||||||
archive
|
archive
|
||||||
"--write-to-folder"
|
"--write-to-folder"
|
||||||
/nas1
|
/staging
|
||||||
from-immich
|
from-immich
|
||||||
"--from-api-key"
|
"--from-api-key"
|
||||||
"$IMMICH_API_KEY"
|
"$IMMICH_API_KEY"
|
||||||
"--from-server"
|
"--from-server"
|
||||||
"http://immich-server:2283"
|
"http://immich-server:2283"
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: nas1
|
- name: staging
|
||||||
mountPath: /nas1
|
mountPath: /staging
|
||||||
env:
|
env:
|
||||||
- name: IMMICH_API_KEY
|
- name: IMMICH_API_KEY
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: immich-login
|
name: immich-login
|
||||||
key: apikey
|
key: apikey
|
||||||
|
containers:
|
||||||
|
- name: rclone-sync
|
||||||
|
image: "rclone/rclone:1.68"
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- "-c"
|
||||||
|
- |
|
||||||
|
rclone sync \
|
||||||
|
--config /rclone-config/rclone.conf \
|
||||||
|
--checksum \
|
||||||
|
--progress \
|
||||||
|
--transfers 4 \
|
||||||
|
--checkers 8 \
|
||||||
|
/staging nas1minio:immich
|
||||||
|
volumeMounts:
|
||||||
|
- name: staging
|
||||||
|
mountPath: /staging
|
||||||
|
- name: rclone-config
|
||||||
|
mountPath: /rclone-config
|
||||||
|
readOnly: true
|
||||||
|
|||||||
Reference in New Issue
Block a user