mirror of
https://gitlab.kube.huskypup.net/Scooby/Homelabv4.git
synced 2026-08-20 23:16:49 +00:00
Fix CNPG distributed-topology validation errors
Confirmed live against the vcluster.cnpg.io admission webhook: (1) replica.enabled is mutually exclusive with primary/self - they're two different mechanisms (old single-source replica-cluster mode vs the newer distributed-topology model), not composable. (2) Both replica.self and replica.primary must reference names present in THAT cluster's own externalClusters list - including a self-referencing entry, even though it describes the cluster itself. Renamed VPS's 'home-backup' external cluster to 'home' throughout (bootstrap.recovery.source too) so one name consistently satisfies barmanObjectStore, connectionParameters, and the primary reference; added matching self-referencing entries on both sides.
This commit is contained in:
@@ -99,7 +99,31 @@ spec:
|
|||||||
# route (same path used for MinIO/CrowdSec backups all session) - no
|
# route (same path used for MinIO/CrowdSec backups all session) - no
|
||||||
# UniFi port-forward needed for this direction, only the reverse
|
# UniFi port-forward needed for this direction, only the reverse
|
||||||
# (VPS/witness reaching INTO home) needed that.
|
# (VPS/witness reaching INTO home) needed that.
|
||||||
|
# CNPG's distributed-topology validation requires both replica.self and
|
||||||
|
# replica.primary to reference names present in THIS cluster's OWN
|
||||||
|
# externalClusters list - including a self-referencing entry (confirmed
|
||||||
|
# live: "External cluster home not found" until one was added, even
|
||||||
|
# though "home" is this very cluster). The "home" entry's
|
||||||
|
# connectionParameters point at its own local -rw service - never
|
||||||
|
# actually dialed while primary: home (that's this cluster), it only
|
||||||
|
# exists to satisfy the name-reference validation.
|
||||||
externalClusters:
|
externalClusters:
|
||||||
|
- name: home
|
||||||
|
connectionParameters:
|
||||||
|
host: pg-authentik-rw
|
||||||
|
port: "5432"
|
||||||
|
dbname: app
|
||||||
|
user: streaming_replica
|
||||||
|
sslmode: verify-ca
|
||||||
|
sslCert:
|
||||||
|
name: pg-authentik-replication
|
||||||
|
key: tls.crt
|
||||||
|
sslKey:
|
||||||
|
name: pg-authentik-replication
|
||||||
|
key: tls.key
|
||||||
|
sslRootCert:
|
||||||
|
name: pg-authentik-ca
|
||||||
|
key: ca.crt
|
||||||
- name: vps
|
- name: vps
|
||||||
connectionParameters:
|
connectionParameters:
|
||||||
host: 100.108.113.41
|
host: 100.108.113.41
|
||||||
@@ -120,9 +144,11 @@ spec:
|
|||||||
# Distributed topology: both sides agree home is primary today. Failover
|
# Distributed topology: both sides agree home is primary today. Failover
|
||||||
# flips the VPS's replica.primary to "vps" (+ promotion token) - see the
|
# flips the VPS's replica.primary to "vps" (+ promotion token) - see the
|
||||||
# plan doc's failover-watcher section. Failback is the same in reverse,
|
# plan doc's failover-watcher section. Failback is the same in reverse,
|
||||||
# deliberately manual.
|
# deliberately manual. No replica.enabled here - that flag belongs to
|
||||||
|
# CNPG's older single-source replica-cluster mode and is mutually
|
||||||
|
# exclusive with primary/self (confirmed live: "replica mode enabled is
|
||||||
|
# not compatible with the primary field").
|
||||||
replica:
|
replica:
|
||||||
self: home
|
self: home
|
||||||
primary: home
|
primary: home
|
||||||
source: vps # where home would replicate FROM if it were ever a replica (not active now - primary: home)
|
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ spec:
|
|||||||
|
|
||||||
bootstrap:
|
bootstrap:
|
||||||
recovery:
|
recovery:
|
||||||
source: home-backup
|
source: home
|
||||||
|
|
||||||
# Multi-site active failover pilot (see
|
# Multi-site active failover pilot (see
|
||||||
# /home/scooby/.claude/plans/jiggly-snacking-iverson.md) - the
|
# /home/scooby/.claude/plans/jiggly-snacking-iverson.md) - the
|
||||||
@@ -90,11 +90,25 @@ spec:
|
|||||||
# just the VPS and witness public IPs. NOT the Netbird mesh directly -
|
# just the VPS and witness public IPs. NOT the Netbird mesh directly -
|
||||||
# UniFi has no route to that CIDR, confirmed live (see
|
# UniFi has no route to that CIDR, confirmed live (see
|
||||||
# infrastructure/ha-failover/manifests/etcd.yaml for the full story).
|
# infrastructure/ha-failover/manifests/etcd.yaml for the full story).
|
||||||
|
# externalClusters[].name is now "home" (was "home-backup") - reused
|
||||||
|
# consistently for bootstrap.recovery.source, replica.primary, AND the
|
||||||
|
# connectionParameters below, since CNPG's distributed-topology
|
||||||
|
# validation requires replica.primary to match an externalClusters name
|
||||||
|
# exactly (confirmed live: "External cluster home not found" when it
|
||||||
|
# didn't). serverName inside barmanObjectStore is unaffected by this
|
||||||
|
# rename - it's an explicit separate override, not derived from the
|
||||||
|
# entry name.
|
||||||
|
#
|
||||||
|
# Also needs a self-referencing "vps" entry below (same reason -
|
||||||
|
# replica.self must match an externalClusters name too, even though
|
||||||
|
# it's this very cluster) - its connectionParameters point at VPS's own
|
||||||
|
# local -rw service, never actually dialed while this cluster is a
|
||||||
|
# replica.
|
||||||
externalClusters:
|
externalClusters:
|
||||||
- name: home-backup
|
- name: home
|
||||||
barmanObjectStore:
|
barmanObjectStore:
|
||||||
# serverName defaults to the externalClusters[].name ("home-backup")
|
# serverName defaults to the externalClusters[].name here, NOT
|
||||||
# here, NOT the source Postgres cluster's actual name - but home's
|
# the source Postgres cluster's actual name - but home's
|
||||||
# barmanObjectStore backup: block (on the pg-authentik Cluster
|
# barmanObjectStore backup: block (on the pg-authentik Cluster
|
||||||
# itself) defaults serverName to its own metadata.name
|
# itself) defaults serverName to its own metadata.name
|
||||||
# ("pg-authentik"). Without this override, recovery looks for
|
# ("pg-authentik"). Without this override, recovery looks for
|
||||||
@@ -126,13 +140,32 @@ spec:
|
|||||||
sslRootCert:
|
sslRootCert:
|
||||||
name: pg-authentik-home-ca
|
name: pg-authentik-home-ca
|
||||||
key: ca.crt
|
key: ca.crt
|
||||||
|
- name: vps
|
||||||
|
connectionParameters:
|
||||||
|
host: pg-authentik-rw
|
||||||
|
port: "5432"
|
||||||
|
dbname: app
|
||||||
|
user: streaming_replica
|
||||||
|
sslmode: verify-ca
|
||||||
|
sslCert:
|
||||||
|
name: pg-authentik-replication
|
||||||
|
key: tls.crt
|
||||||
|
sslKey:
|
||||||
|
name: pg-authentik-replication
|
||||||
|
key: tls.key
|
||||||
|
sslRootCert:
|
||||||
|
name: pg-authentik-ca
|
||||||
|
key: ca.crt
|
||||||
|
|
||||||
# Distributed topology: both sides agree home is primary today.
|
# Distributed topology: both sides agree home is primary today. No
|
||||||
|
# replica.enabled - that flag belongs to CNPG's older single-source
|
||||||
|
# replica-cluster mode and is mutually exclusive with primary/self
|
||||||
|
# (confirmed live: "replica mode enabled is not compatible with the
|
||||||
|
# primary field").
|
||||||
replica:
|
replica:
|
||||||
enabled: true
|
|
||||||
self: vps
|
self: vps
|
||||||
primary: home
|
primary: home
|
||||||
source: home-backup
|
source: home
|
||||||
|
|
||||||
monitoring:
|
monitoring:
|
||||||
enablePodMonitor: false # no Prometheus on the VPS cluster
|
enablePodMonitor: false # no Prometheus on the VPS cluster
|
||||||
|
|||||||
Reference in New Issue
Block a user