Files
Homelabv4/infrastructure/vps-standby/n8n/manifests/cnpg-cluster.yaml
T
Scooby Husky 6e054a46b6 Fix VPS replica clusters: barmanObjectStore serverName mismatch
CNPG's barmanObjectStore.serverName defaults to the externalClusters[]
entry's own .name field ('home-backup', an arbitrary label I chose) -
NOT the actual source Postgres cluster's name. Home's backup: block
(on the real pg-authentik/pg-n8n/pg-nextcloud Clusters) defaults
serverName to its own metadata.name instead. Without an explicit
override these two disagree, so recovery searches the object store
under the wrong server-name prefix and finds nothing - 'no target
backup found', confirmed live even after the ScheduledBackup fix
produced real, completed base backups.
2026-08-17 22:56:51 -05:00

62 lines
1.7 KiB
YAML

---
# CNPG replica cluster continuously replaying WAL from home's pg-n8n
# (apps/n8n/manifests/cnpg-cluster.yaml) via VPS MinIO's
# cnpg-backups/pg-n8n bucket path. Same pattern as
# infrastructure/vps-standby/authentik/manifests/cnpg-cluster.yaml - see
# that file's comments for the full rationale (replica-cluster mode vs.
# custom restore scripting, read-only until manual promotion).
#
# vps-minio-secret is a plain Secret copied here manually (kubectl, not
# git), same as the authentik one:
# kubectl -n n8n create secret generic vps-minio-secret \
# --from-literal=accesskey=<vps minio root user> \
# --from-literal=secretkey=<vps minio root password>
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: pg-n8n
namespace: n8n
spec:
imageName: ghcr.io/cloudnative-pg/postgresql:16
instances: 1
resources:
requests:
memory: "256Mi"
cpu: "25m"
limits:
memory: "1Gi"
cpu: "250m"
storage:
size: 10Gi
storageClass: local-path
bootstrap:
recovery:
source: home-backup
externalClusters:
- name: home-backup
barmanObjectStore:
# See infrastructure/vps-standby/authentik/manifests/cnpg-cluster.yaml
# for why this override is required (serverName defaults to the
# externalClusters[].name, not the source cluster's real name).
serverName: pg-n8n
destinationPath: s3://cnpg-backups/pg-n8n
endpointURL: http://vps-minio.minio.svc.cluster.local:9000
s3Credentials:
accessKeyId:
name: vps-minio-secret
key: accesskey
secretAccessKey:
name: vps-minio-secret
key: secretkey
replica:
enabled: true
source: home-backup
monitoring:
enablePodMonitor: false