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>
83 lines
1.8 KiB
YAML
83 lines
1.8 KiB
YAML
# n8n — workflow automation
|
|
# PostgreSQL backend via cluster DNS: postgres
|
|
# Unpinned — scheduler places freely, local-path PVC
|
|
# NodePort 32374
|
|
#
|
|
# Deploy:
|
|
# kubectl create secret generic n8n-secret \
|
|
# --namespace <ns> \
|
|
# --from-literal=db-password='<password>'
|
|
# kubectl apply -f n8n-db-init.yaml -n <ns>
|
|
# kubectl get jobs -n <ns> -w # wait for completion
|
|
# kubectl apply -f n8n.yaml -n <ns>
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: n8n-pvc
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: local-path
|
|
resources:
|
|
requests:
|
|
storage: 5Gi
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: n8n
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: n8n
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: n8n
|
|
spec:
|
|
containers:
|
|
- name: n8n
|
|
image: n8nio/n8n:latest
|
|
env:
|
|
- name: DB_TYPE
|
|
value: postgresdb
|
|
- name: DB_POSTGRESDB_HOST
|
|
value: postgres
|
|
- name: DB_POSTGRESDB_PORT
|
|
value: "5432"
|
|
- name: DB_POSTGRESDB_DATABASE
|
|
value: n8n_db
|
|
- name: DB_POSTGRESDB_USER
|
|
value: n8n_user
|
|
- name: DB_POSTGRESDB_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: n8n-secret
|
|
key: db-password
|
|
ports:
|
|
- containerPort: 5678
|
|
volumeMounts:
|
|
- name: n8n-data
|
|
mountPath: /home/node/.n8n
|
|
volumes:
|
|
- name: n8n-data
|
|
persistentVolumeClaim:
|
|
claimName: n8n-pvc
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: n8n
|
|
spec:
|
|
selector:
|
|
app: n8n
|
|
ports:
|
|
- port: 5678
|
|
targetPort: 5678
|
|
nodePort: 32374
|
|
type: NodePort
|