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:
@@ -99,7 +99,7 @@ spec:
|
||||
volumes:
|
||||
- name: gitlab-data # lokal (postgresql, redis, etc.)
|
||||
persistentVolumeClaim:
|
||||
claimName: gitlab-data-pvc
|
||||
claimName: gitlab-data-longhorn-pvc
|
||||
|
||||
- name: gitlab-git # NFS (Git-Repositories)
|
||||
persistentVolumeClaim:
|
||||
@@ -107,7 +107,7 @@ spec:
|
||||
|
||||
- name: gitlab-config # lokal
|
||||
persistentVolumeClaim:
|
||||
claimName: gitlab-config-pvc
|
||||
claimName: gitlab-config-longhorn-pvc
|
||||
|
||||
- name: gitlab-logs # ephemeral
|
||||
emptyDir: {}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
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
|
||||
@@ -96,3 +96,32 @@ spec:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
volumeName: gitlab-config-pv
|
||||
|
||||
---
|
||||
# ─── Neue Longhorn-PVCs zum Migrieren der Daten (dynamisch provisioniert) ─
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: gitlab-data-longhorn-pvc
|
||||
namespace: gitlab
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: longhorn
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: gitlab-config-longhorn-pvc
|
||||
namespace: gitlab
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: longhorn
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
|
||||
Reference in New Issue
Block a user