42c1794d0e
The migrate Job was a PreSync hook but connects to postgres-rw, whose CNPG Cluster + generated postgres-app secret apply in the Sync phase (after all PreSync hooks). On a fresh install migrate ran before Postgres existed, failed, exhausted backoffLimit, failed PreSync, and blocked the Sync phase that creates the DB. - Move migrate off PreSync to a Sync-phase hook at sync-wave 1. - Put the CNPG Cluster + backup resources, VSO auth/secrets, and Certificate at wave 0 so the DB is Healthy (and creds/cert exist) before migrate runs. - Put the Deployment + Service/Gateway/HTTPRoute/PDB/VMServiceScrape at wave 2 so serve starts after migrate completes. - Add a writable /tmp emptyDir to the serve container and migrate Job (root FS is read-only) so codeload/staging writes cannot crash the process.
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
---
|
|
# Ceph RGW (S3) backup target for the ghp CNPG cluster, provisioned by the
|
|
# in-estate cephrgw-operator. One dedicated bucket + owner user per cluster.
|
|
apiVersion: ceph.unkin.net/v1alpha1
|
|
kind: ObjectStoreUser
|
|
metadata:
|
|
name: cnpg-ghp-backup
|
|
namespace: ghp
|
|
annotations:
|
|
argocd.argoproj.io/sync-wave: "0"
|
|
spec:
|
|
displayName: "CNPG backup owner (ghp)"
|
|
uid: cnpg-ghp-backup
|
|
maxBuckets: 5
|
|
secretName: cnpg-ghp-backup-s3
|
|
retainOnDelete: true
|
|
---
|
|
apiVersion: ceph.unkin.net/v1alpha1
|
|
kind: Bucket
|
|
metadata:
|
|
name: cnpg-ghp
|
|
namespace: ghp
|
|
annotations:
|
|
argocd.argoproj.io/sync-wave: "0"
|
|
spec:
|
|
placementTarget: ec
|
|
bucketName: cnpg-ghp
|
|
ownerRef: cnpg-ghp-backup
|
|
versioning: false
|
|
tags:
|
|
app: ghp
|
|
purpose: cnpg-backup
|
|
retainOnDelete: true
|
|
---
|
|
# Nightly base backup; continuous WAL archiving is always-on via the Cluster's
|
|
# spec.backup.barmanObjectStore. Staggered off other clusters' schedules.
|
|
apiVersion: postgresql.cnpg.io/v1
|
|
kind: ScheduledBackup
|
|
metadata:
|
|
name: cnpg-ghp-nightly
|
|
namespace: ghp
|
|
annotations:
|
|
argocd.argoproj.io/sync-wave: "0"
|
|
spec:
|
|
schedule: "0 50 1 * * *"
|
|
immediate: false
|
|
backupOwnerReference: self
|
|
method: barmanObjectStore
|
|
cluster:
|
|
name: postgres
|