Files
HomeLabScripts/k3s/apps/gitLab/manifest/migrate-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

48 lines
1.5 KiB
YAML

apiVersion: batch/v1
kind: Job
metadata:
name: gitlab-migrate-to-longhorn
namespace: gitlab
spec:
backoffLimit: 4
template:
metadata:
name: gitlab-migrate-to-longhorn
spec:
restartPolicy: Never
containers:
- name: migrate
image: alpine:3.18
command:
- sh
- -c
- |
set -euo pipefail
apk add --no-cache rsync
echo "Starting migration: /var/opt/gitlab (data)"
rsync -aHAX --numeric-ids --delete /var/opt_gitlab_old/ /var/opt_gitlab_new/
echo "Finished data copy. Starting config copy: /etc/gitlab"
rsync -aHAX --numeric-ids --delete /etc_gitlab_old/ /etc_gitlab_new/
echo "Migration complete"
volumeMounts:
- name: old-data
mountPath: /var/opt_gitlab_old
- name: new-data
mountPath: /var/opt_gitlab_new
- name: old-config
mountPath: /etc_gitlab_old
- name: new-config
mountPath: /etc_gitlab_new
volumes:
- name: old-data
persistentVolumeClaim:
claimName: gitlab-data-pvc
- name: new-data
persistentVolumeClaim:
claimName: gitlab-data-longhorn-pvc
- name: old-config
persistentVolumeClaim:
claimName: gitlab-config-pvc
- name: new-config
persistentVolumeClaim:
claimName: gitlab-config-longhorn-pvc