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>
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
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
|
||||
Reference in New Issue
Block a user