ADD: implement migration scripts for PostgreSQL to Longhorn; update Immich configurations for namespace and persistent storage
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: immich-db-nfs-to-longhorn
|
||||
namespace: immich
|
||||
spec:
|
||||
backoffLimit: 2
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: migrate-db
|
||||
image: alpine:3.20
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
set -e
|
||||
apk add --no-cache rsync
|
||||
test -d /source/postgres
|
||||
mkdir -p /target/postgres
|
||||
rsync -aHAX --numeric-ids /source/postgres/ /target/postgres/
|
||||
test -f /target/postgres/PG_VERSION
|
||||
test -d /target/postgres/base
|
||||
volumeMounts:
|
||||
- name: source-nfs
|
||||
mountPath: /source
|
||||
readOnly: true
|
||||
- name: target-longhorn
|
||||
mountPath: /target
|
||||
volumes:
|
||||
- name: source-nfs
|
||||
nfs:
|
||||
server: 192.168.178.166
|
||||
path: /export/fastData/immichDB
|
||||
- name: target-longhorn
|
||||
persistentVolumeClaim:
|
||||
claimName: immich-db-pvc
|
||||
Reference in New Issue
Block a user