Replaced Headscale (too buggy in 0.28.x — random node drops) with direct WireGuard hub-and-spoke + full mesh. 7 Proxmox VMs across 3 hosts form a K3s v1.34.6 cluster: 3 control-plane/etcd nodes, 4 workers. Running services: postgres, mariadb, ghost (x3), forgejo, authentik. All unpinned services use local-path StorageClass. Databases pinned to pve-worker and adder-worker with local PVs. Includes VM provisioning scripts (create-debian-template.sh, clone-vm.sh), K3s manifests for all services, and full deployment docs in k3s/README.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
86 lines
2 KiB
YAML
86 lines
2 KiB
YAML
# Forgejo — self-hosted Git forge
|
|
# PostgreSQL backend via cluster DNS: postgres
|
|
# Unpinned — scheduler places freely, local-path PVC for /data
|
|
# NodePort 32371
|
|
#
|
|
# Deploy:
|
|
# kubectl create secret generic forgejo-secret \
|
|
# --from-literal=db-password='<password>'
|
|
# kubectl apply -f forgejo-db-init.yaml
|
|
# kubectl get jobs -w # wait for completion
|
|
# kubectl apply -f forgejo.yaml
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: forgejo-pvc
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: local-path
|
|
resources:
|
|
requests:
|
|
storage: 10Gi
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: forgejo
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: forgejo
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: forgejo
|
|
spec:
|
|
containers:
|
|
- name: forgejo
|
|
image: codeberg.org/forgejo/forgejo:9
|
|
env:
|
|
- name: USER_UID
|
|
value: "1000"
|
|
- name: USER_GID
|
|
value: "1000"
|
|
- name: FORGEJO__database__DB_TYPE
|
|
value: postgres
|
|
- name: FORGEJO__database__HOST
|
|
value: postgres:5432
|
|
- name: FORGEJO__database__NAME
|
|
value: forgejo_db
|
|
- name: FORGEJO__database__USER
|
|
value: forgejo_user
|
|
- name: FORGEJO__database__PASSWD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: forgejo-secret
|
|
key: db-password
|
|
- name: FORGEJO__server__HTTP_PORT
|
|
value: "3000"
|
|
ports:
|
|
- containerPort: 3000
|
|
volumeMounts:
|
|
- name: forgejo-data
|
|
mountPath: /data
|
|
volumes:
|
|
- name: forgejo-data
|
|
persistentVolumeClaim:
|
|
claimName: forgejo-pvc
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: forgejo
|
|
spec:
|
|
selector:
|
|
app: forgejo
|
|
ports:
|
|
- port: 3000
|
|
targetPort: 3000
|
|
nodePort: 32371
|
|
type: NodePort
|