CloudNative Postgres
CloudNative Postgres uses an Operator to watch for new database cluster- and backup- definitions as provided by CRDs.
Operator
The operator is deployed via helm release
Cluster & Backups
S3-compatible storage can be used as a live WAL backup. CNPG now uses a plugin system.
Restore
On versioning: If you end up with an older cloudnative pg backup (i.e. i have a pg14 one) but you’re using a newer operator that defaults to newer (i.e. > 15.1), you wont be able to restore as it will whine about versions. Add an image tag to the cluster spec to deploy a second cluster with a specifically downgraded ver to restore without having to juggle around changing the operator helm etc
CLI
Install the kubectl plugin
Updating postgres versions with CNPG
- Scale down apps using old cluster
- Ensure old cluster is running
- Spin up new cluster, pointing
.connectionParametersto the old cluster - Ensure new cluster has a scheduledBackup pointing to it
- Redirect
ext-postgres-operatorto new cluster (edit the cluster fqdn in the secret) - Redirect apps to new cluster
- Remove the old cluster (remove before scaling up to make sure apps fully switch over)
- Scale up apps 🤞🏼
Refs:
Archiving failed for
Enter postgres shell
psqlReset archiver warning
SELECT pg_stat_reset_shared('archiver');
Refs: