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>
91 lines
2 KiB
YAML
91 lines
2 KiB
YAML
# Synapse — Matrix homeserver
|
|
# PostgreSQL backend via cluster DNS: postgres
|
|
# Unpinned — scheduler places freely, local-path PVC
|
|
# NodePort 32385
|
|
#
|
|
# Deploy:
|
|
# kubectl create secret generic synapse-secret \
|
|
# --namespace <ns> \
|
|
# --from-literal=db-password='<password>'
|
|
# kubectl apply -f synapse-db-init.yaml -n <ns>
|
|
# kubectl get jobs -n <ns> -w # wait for completion
|
|
# kubectl apply -f synapse.yaml -n <ns>
|
|
#
|
|
# First boot generates /data/homeserver.yaml automatically.
|
|
# After first boot, exec into the pod and update homeserver.yaml
|
|
# to add the PostgreSQL database config (replaces default SQLite):
|
|
#
|
|
# database:
|
|
# name: psycopg2
|
|
# args:
|
|
# user: synapse_user
|
|
# password: <from synapse-secret>
|
|
# database: synapse_db
|
|
# host: postgres
|
|
# cp_min: 5
|
|
# cp_max: 10
|
|
#
|
|
# Then restart the deployment:
|
|
# kubectl rollout restart deployment/synapse -n <ns>
|
|
#
|
|
# Set SYNAPSE_SERVER_NAME to the actual Matrix domain before deploying.
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: synapse-pvc
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: local-path
|
|
resources:
|
|
requests:
|
|
storage: 20Gi
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: synapse
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: synapse
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: synapse
|
|
spec:
|
|
containers:
|
|
- name: synapse
|
|
image: matrixdotorg/synapse:latest
|
|
env:
|
|
- name: SYNAPSE_SERVER_NAME
|
|
value: "matrix.sjasoft.com"
|
|
- name: SYNAPSE_REPORT_STATS
|
|
value: "no"
|
|
ports:
|
|
- containerPort: 8008
|
|
volumeMounts:
|
|
- name: synapse-data
|
|
mountPath: /data
|
|
volumes:
|
|
- name: synapse-data
|
|
persistentVolumeClaim:
|
|
claimName: synapse-pvc
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: synapse
|
|
spec:
|
|
selector:
|
|
app: synapse
|
|
ports:
|
|
- port: 8008
|
|
targetPort: 8008
|
|
nodePort: 32385
|
|
type: NodePort
|