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>
243 lines
5.4 KiB
YAML
243 lines
5.4 KiB
YAML
# Ghost blogs — three instances
|
|
# Unpinned — scheduler places them anywhere
|
|
# Storage via local-path (K3s default provisioner)
|
|
# MariaDB connection via cluster DNS: mariadb
|
|
# Runs in default namespace
|
|
#
|
|
# Deploy:
|
|
# kubectl create secret generic ghost-secrets \
|
|
# --from-literal=ghost1-db-password='<password>' \
|
|
# --from-literal=ghost2-db-password='<password>' \
|
|
# --from-literal=ghost3-db-password='<password>'
|
|
# kubectl apply -f ghost-db-init.yaml
|
|
# kubectl get jobs -w # wait for completion
|
|
# kubectl apply -f ghost.yaml
|
|
|
|
---
|
|
# Ghost 1 — blog.the-fulfillment.org — port 2368
|
|
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: ghost1-pvc
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: local-path
|
|
resources:
|
|
requests:
|
|
storage: 5Gi
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ghost1
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: ghost1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: ghost1
|
|
spec:
|
|
containers:
|
|
- name: ghost1
|
|
image: ghost:5-alpine
|
|
env:
|
|
- name: database__client
|
|
value: mysql
|
|
- name: database__connection__host
|
|
value: mariadb
|
|
- name: database__connection__port
|
|
value: "3306"
|
|
- name: database__connection__user
|
|
value: ghost1_user
|
|
- name: database__connection__password
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ghost-secrets
|
|
key: ghost1-db-password
|
|
- name: database__connection__database
|
|
value: ghost1_db
|
|
- name: url
|
|
value: https://blog.the-fulfillment.org
|
|
ports:
|
|
- containerPort: 2368
|
|
volumeMounts:
|
|
- name: ghost1-storage
|
|
mountPath: /var/lib/ghost/content
|
|
volumes:
|
|
- name: ghost1-storage
|
|
persistentVolumeClaim:
|
|
claimName: ghost1-pvc
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ghost1
|
|
spec:
|
|
selector:
|
|
app: ghost1
|
|
ports:
|
|
- port: 2368
|
|
targetPort: 2368
|
|
nodePort: 32368
|
|
type: NodePort
|
|
|
|
---
|
|
# Ghost 2 — port 2369
|
|
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: ghost2-pvc
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: local-path
|
|
resources:
|
|
requests:
|
|
storage: 5Gi
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ghost2
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: ghost2
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: ghost2
|
|
spec:
|
|
containers:
|
|
- name: ghost2
|
|
image: ghost:5-alpine
|
|
env:
|
|
- name: database__client
|
|
value: mysql
|
|
- name: database__connection__host
|
|
value: mariadb
|
|
- name: database__connection__port
|
|
value: "3306"
|
|
- name: database__connection__user
|
|
value: ghost2_user
|
|
- name: database__connection__password
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ghost-secrets
|
|
key: ghost2-db-password
|
|
- name: database__connection__database
|
|
value: ghost2_db
|
|
- name: url
|
|
value: https://blog.privacy-practice.com
|
|
- name: server__port
|
|
value: "2369"
|
|
ports:
|
|
- containerPort: 2369
|
|
volumeMounts:
|
|
- name: ghost2-storage
|
|
mountPath: /var/lib/ghost/content
|
|
volumes:
|
|
- name: ghost2-storage
|
|
persistentVolumeClaim:
|
|
claimName: ghost2-pvc
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ghost2
|
|
spec:
|
|
selector:
|
|
app: ghost2
|
|
ports:
|
|
- port: 2369
|
|
targetPort: 2369
|
|
nodePort: 32369
|
|
type: NodePort
|
|
|
|
---
|
|
# Ghost 3 — port 2370
|
|
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: ghost3-pvc
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: local-path
|
|
resources:
|
|
requests:
|
|
storage: 5Gi
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ghost3
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: ghost3
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: ghost3
|
|
spec:
|
|
containers:
|
|
- name: ghost3
|
|
image: ghost:5-alpine
|
|
env:
|
|
- name: database__client
|
|
value: mysql
|
|
- name: database__connection__host
|
|
value: mariadb
|
|
- name: database__connection__port
|
|
value: "3306"
|
|
- name: database__connection__user
|
|
value: ghost3_user
|
|
- name: database__connection__password
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ghost-secrets
|
|
key: ghost3-db-password
|
|
- name: database__connection__database
|
|
value: ghost3_db
|
|
- name: url
|
|
value: https://blog.sjasoft.com
|
|
- name: server__port
|
|
value: "2370"
|
|
ports:
|
|
- containerPort: 2370
|
|
volumeMounts:
|
|
- name: ghost3-storage
|
|
mountPath: /var/lib/ghost/content
|
|
volumes:
|
|
- name: ghost3-storage
|
|
persistentVolumeClaim:
|
|
claimName: ghost3-pvc
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ghost3
|
|
spec:
|
|
selector:
|
|
app: ghost3
|
|
ports:
|
|
- port: 2370
|
|
targetPort: 2370
|
|
nodePort: 32370
|
|
type: NodePort
|