Files
HomeLabScripts/k3s/apps/gitea/migrate-postgres-to-longhorn.yaml
T
henry 39079615f5 Add migration scripts and manifests for GitLab and Gitea to Longhorn
- Create .vscode/settings.json for YAML schema validation.
- Add WISSENSBASIS.md for documentation on HomeLabScripts.
- Implement migration job for GitLab from NFS to Longhorn with migrate-to-longhorn.yaml and migrate-to-longhorn.sh.
- Add Gitea migration scripts and manifests for PostgreSQL to Longhorn.
- Create persistent volume claims and deployments for Gitea and Homarr.
- Set up namespaces and services for Homarr and Speedtest Tracker.
- Add secrets for Homarr and Speedtest Tracker with sensitive data.
- Configure Ingress for Speedtest Tracker with Traefik annotations.

Co-authored-by: Copilot <copilot@github.com>
2026-04-24 23:08:23 +02:00

50 lines
1.4 KiB
YAML

apiVersion: batch/v1
kind: Job
metadata:
name: gitea-postgres-migrate-to-longhorn
namespace: gitea
spec:
backoffLimit: 2
template:
metadata:
name: gitea-postgres-migrate-to-longhorn
spec:
restartPolicy: Never
containers:
- name: migrate
image: alpine:3.20
command:
- sh
- -c
- |
set -euo pipefail
apk add --no-cache rsync findutils coreutils
src_count="$(find /source -mindepth 1 | wc -l | tr -d ' ')"
echo "Source entries before copy: ${src_count}"
rsync -aHAX --numeric-ids --delete /source/ /target/
target_count="$(find /target -mindepth 1 | wc -l | tr -d ' ')"
echo "Target entries after copy: ${target_count}"
test -f /target/PG_VERSION
test -d /target/base
test "${target_count}" -gt 0
echo "Top-level target contents:"
ls -la /target
echo "Migration verification successful"
volumeMounts:
- name: source
mountPath: /source
readOnly: true
- name: target
mountPath: /target
volumes:
- name: source
persistentVolumeClaim:
claimName: postgres-pvc
- name: target
persistentVolumeClaim:
claimName: postgres-longhorn-pvc