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,97 @@
|
||||
# HomeLabScripts – Wissensbasis
|
||||
|
||||
## Zweck
|
||||
Persönliches Home-Lab-Infrastruktur-Repository. Orchestriert eine selbst gehostete Cloud-Umgebung auf K3s (Kubernetes) auf lokaler Hardware.
|
||||
|
||||
## Technologien
|
||||
- **K3s** – Kubernetes-Distribution
|
||||
- **Helm** – Paketmanager für K8s
|
||||
- **NFS** – Netzwerk-Dateisystem (shared storage)
|
||||
- **Longhorn** – verteilter Block-Storage (2 Replicas)
|
||||
- **PostgreSQL / MariaDB / Redis** – Datenbanken & Caching
|
||||
- **Authentik** – OAuth2/OIDC-Authentifizierungsserver
|
||||
|
||||
---
|
||||
|
||||
## Repo-Struktur
|
||||
```
|
||||
HomeLabScripts/
|
||||
├── k3s/
|
||||
│ ├── apps/ # App-Manifeste & Helm-Charts
|
||||
│ ├── install.sh # K3s-Cluster-Installation
|
||||
│ ├── get_helm.sh # Helm herunterladen
|
||||
│ ├── installHelm.sh # Helm installieren
|
||||
│ └── k8sUser/ # Benutzer-/Kubeconfig-Setup
|
||||
├── nfs/ # NFS-Server- & Client-Skripte
|
||||
└── mountscript/ # Disk-Partitionierung & Einhängen
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Anwendungen
|
||||
|
||||
| App | Namespace | NodePort | Storage | Beschreibung |
|
||||
|-----|-----------|----------|---------|--------------|
|
||||
| **Authentik** | authentik | 32222 | PostgreSQL (intern) | OAuth2/OIDC-Provider |
|
||||
| **Homarr** | homarr | 30757 | Longhorn 5Gi | Homepage-Dashboard |
|
||||
| **K8s Dashboard** | kubernetes-dashboard | 443 | – | Cluster-Management-UI |
|
||||
| **Gitea** | gitea | – | NFS 30Gi (Repos) + 10Gi (DB) | Leichter Git-Dienst |
|
||||
| **GitLab** | gitlab | 80/443/22 | NFS 50Gi (RWX) | Full GitLab mit CI/CD |
|
||||
| **Nextcloud** | nextcloud | 30180 | NFS (Daten) + Longhorn (DB) | Datei-Hosting |
|
||||
| **Immich** | photoprism | 3001/2283 | NFS photos | Fotoverwaltung (Google Photos Alternative) |
|
||||
| **PhotoPrism** | photoprism | – | NFS photos | KI-Fotoverwaltung |
|
||||
| **iCloudPD** | photoprism | – | NFS /data/originals | Apple-iCloud-Foto-Sync |
|
||||
| **Longhorn** | longhorn-system | – | – | Storage-Provisioner |
|
||||
|
||||
---
|
||||
|
||||
## Storage-Strategie
|
||||
- **Longhorn** → Datenbanken, kleine Konfigurationen (schnell, lokal)
|
||||
- **NFS** → Medien, Repos, Nextcloud-Daten (groß, geteilt, RWX)
|
||||
- NFS-Server: `192.168.178.166`, Pfade: `/export/fastData/`, `/export/slowData/`
|
||||
|
||||
---
|
||||
|
||||
## Netzwerk
|
||||
- **NodePort** für externen Zugriff
|
||||
- **ClusterIP** für Pod-to-Pod-Kommunikation (DBs)
|
||||
- **Multus** bei Immich (separates IoT-Netz: `192.168.1.192/24`)
|
||||
- Domain: `henryathome.home64.de`
|
||||
|
||||
---
|
||||
|
||||
## Datenbank-Zuordnung
|
||||
| App | DB-Typ | User | Hinweis |
|
||||
|-----|--------|------|---------|
|
||||
| Authentik | PostgreSQL | – | intern |
|
||||
| Nextcloud | MariaDB 10.8 | nextcloud | PW: nextcloud |
|
||||
| GitLab | MariaDB | – | NFS-Backend |
|
||||
| Gitea | PostgreSQL | – | NFS-Backend |
|
||||
| Immich | PostgreSQL 14 (pgvecto-rs) | immich | PW: password |
|
||||
| PhotoPrism | MariaDB | photoprism | PW: photoprism |
|
||||
|
||||
---
|
||||
|
||||
## Wichtige Skripte
|
||||
|
||||
| Skript | Zweck |
|
||||
|--------|-------|
|
||||
| `k3s/install.sh` | K3s installieren |
|
||||
| `k3s/installHelm.sh` | Helm 3 installieren |
|
||||
| `k3s/k8sUser/addUser.sh` | ServiceAccount + ClusterRoleBinding + Kubeconfig erstellen |
|
||||
| `k3s/apps/dashboard/getToken.sh` | Admin-Token für K8s Dashboard |
|
||||
| `k3s/apps/photo/icloudpd/base64pw.sh` | iCloud-Passwort base64-kodieren |
|
||||
| `k3s/apps/Nextcloud/helm/cleanRestart.sh` | Nextcloud sauber neu starten |
|
||||
| `nfs/server.sh` | NFS-Server konfigurieren |
|
||||
| `nfs/client.sh` / `nfsClient2.sh` | NFS-Client einrichten & in fstab eintragen |
|
||||
| `mountscript/mount-plus.sh` | Festplatte partitionieren, formatieren, einhängen |
|
||||
|
||||
---
|
||||
|
||||
## Muster & Konventionen
|
||||
- Secrets: `*-secret.yaml` je App, base64-kodiert
|
||||
- Init-Container: Warten auf DB-Bereitschaft (Nextcloud, Immich)
|
||||
- `imagePullPolicy: IfNotPresent` (kein automatisches Re-Pull)
|
||||
- `nodeSelector: knode0` bei Nextcloud (Kernel 6.1 für NFS)
|
||||
- fsGroup für NFS-Berechtigungen (z. B. `33` für www-data)
|
||||
- GitLab-Runner-Token: `glrt-3nNma_nEvL1Bq2zc8m5Zu286MQpwOjIKdDozCnU6MTAQ`
|
||||
Reference in New Issue
Block a user