diff --git a/kubernetes/apps/ha-restore-test/cluster.yaml b/kubernetes/apps/ha-restore-test/cluster.yaml index 455ae8ec..c1a9be61 100644 --- a/kubernetes/apps/ha-restore-test/cluster.yaml +++ b/kubernetes/apps/ha-restore-test/cluster.yaml @@ -9,13 +9,18 @@ # never writes a base backup. serverName differs from ha-pg as a second # guard; see objectstore.yaml. # +# Named ha-pg-restore-2: the first instance pod predates the plugin and the +# operator will not roll it (it waits on an in-place restart the dead instance +# manager cannot answer). A new name makes Flux prune the old Cluster and +# create this one with the sidecar from the start. +# # One instance, no walStorage, ceph-block-ephemeral (reclaim Delete) so # nothing outlives the namespace. 32Gi matches ha-pg's PGDATA: the restored # data plus the WAL replayed since the last base backup. apiVersion: postgresql.cnpg.io/v1 kind: Cluster metadata: - name: ha-pg-restore + name: ha-pg-restore-2 namespace: ha-restore-test spec: instances: 1 diff --git a/kubernetes/apps/ha-restore-test/network-policy.yaml b/kubernetes/apps/ha-restore-test/network-policy.yaml index a8e5b8d8..79f5ec93 100644 --- a/kubernetes/apps/ha-restore-test/network-policy.yaml +++ b/kubernetes/apps/ha-restore-test/network-policy.yaml @@ -29,7 +29,7 @@ metadata: spec: endpointSelector: matchLabels: - cnpg.io/cluster: ha-pg-restore + cnpg.io/cluster: ha-pg-restore-2 ingress: - fromEndpoints: - matchLabels: @@ -68,7 +68,7 @@ spec: egress: - toEndpoints: - matchLabels: - cnpg.io/cluster: ha-pg-restore + cnpg.io/cluster: ha-pg-restore-2 toPorts: - ports: - port: "5432" diff --git a/kubernetes/apps/ha-restore-test/pg-check-job.yaml b/kubernetes/apps/ha-restore-test/pg-check-job.yaml index ce7c1132..ecd7a694 100644 --- a/kubernetes/apps/ha-restore-test/pg-check-job.yaml +++ b/kubernetes/apps/ha-restore-test/pg-check-job.yaml @@ -3,7 +3,7 @@ apiVersion: batch/v1 kind: Job metadata: - name: ha-pg-check + name: ha-pg-check-2 namespace: ha-restore-test spec: backoffLimit: 2 @@ -24,7 +24,7 @@ spec: image: ghcr.io/cloudnative-pg/postgresql:16 env: - name: PGHOST - value: ha-pg-restore-rw + value: ha-pg-restore-2-rw - name: PGDATABASE value: homeassistant - name: PGUSER @@ -32,7 +32,7 @@ spec: - name: PGPASSWORD valueFrom: secretKeyRef: - name: ha-pg-restore-superuser + name: ha-pg-restore-2-superuser key: password command: - bash