Release date: Oct 12, 2023
!!! Important "Important changes from previous versions" This release contains a few changes to the default settings of CloudNativePG with the goal to improve general stability and security through predefined values. If you are upgrading from a previous version, please carefully read the "Important Changes" section below, as well as the upgrade documentation.
Features:
-
Volume Snapshot support for backup and recovery: leverage the standard Kubernetes API on Volume Snapshots to take advantage of capabilities like incremental and differential copy for both backup and recovery operations. This first step, covering cold backups from a standby, will continue in 1.22 with support for hot backups using the PostgreSQL API and tablespaces.
-
OLM installation method: introduce support for Operator Lifecycle Manager via OperatorHub.io for the latest patch version of the latest minor release through the stable channel. Many thanks to EDB for donating the bundle of their "EDB Postgres for Kubernetes" operator and adapting it for CloudNativePG.
Important Changes:
- Change the default value of
stopDelayto 1800 seconds instead of 30 seconds (#2848) - Introduce a new parameter, called
smartShutdownTimeout, to control the window of time reserved for the smart shutdown of Postgres to complete; the general formula to compute the overall timeout to stop Postgres ismax(stopDelay - smartShutdownTimeout, 30)(#2848) - Change the default value of
startDelayto 3600, instead of 30 seconds (#2847) - Replace the livenessProbe initial delay with a more proper Kubernetes startup probe to deal with the start of a Postgres server (#2847)
- Change the default value of
switchoverDelayto 3600 seconds instead of 40000000 seconds (#2846) - Disable superuser access by default for security (#2905)
- Enable replication slots for HA by default (#2903)
- Stop supporting the
postgresqllabel - replaced bycnpg.io/clusterin 1.18 (#2744)
Security:
- Add a default
seccompProfileto the operator deployment (#2926)
Enhancements:
- Enable bootstrap of a replica cluster from a consistent set of volume snapshots (#2647)
- Enable full and Point In Time recovery from a consistent set of volume snapshots (#2390)
- Introduce the
cnpg.io/coredumpFilterannotation to control the content of a core dump generated in the unlikely event of a PostgreSQL crash, by default set to exclude shared memory segments from the dump (#2733) - Allow to configure ephemeral-storage limits for the shared memory and temporary data ephemeral volumes (#2830)
- Validate resource limits and requests through the webhook (#2663)
- Ensure that PostgreSQL's
shared_buffersare coherent with the pods' allocated memory resources (#2840) - Add
uriandjdbc-urifields in the credential secrets to facilitate developers when connecting their applications to the database (#2186) - Add a new phase
Waiting for the instances to become activefor finer control of a cluster's state waiting for the replicas to be ready (#2612) - Improve detection of Pod rollout conditions through the
podSpecannotation (#2243) - Add primary timestamp and uptime to the kubectl plugin's
statuscommand (#2953)
Fixes:
-
Ensure that the primary instance is always recreated first by prioritizing ready PVCs with a primary role (#2544)
-
Honor the
cnpg.io/skipEmptyWalArchiveCheckannotation during recovery to bypass the check for an empty WAL archive (#2731) -
Prevent a cluster from being stuck when the PostgreSQL server is down but the pod is up on the primary (#2966)
-
Avoid treating the designated primary in a replica cluster as a regular HA replica when replication slots are enabled (#2960)
-
Reconcile services every time the selectors change or when labels/annotations need to be changed (#2918)
-
Defaults to
appboth the owner and database during recovery bootstrap (#2957) -
Avoid write-read concurrency on cached cluster (#2884)
-
Remove empty items, make them unique and sort in the
ResourceNamesections of the generated roles (#2875) -
Ensure that the
ContinuousArchivingcondition is properly set to 'failed' in case of errors (#2625) -
Make the
Backupresource reconciliation cycle more resilient on interruptions by stopping only if the backup is completed or failed (#2591) -
Reconcile PodMonitor
labelsandannotations(#2583) -
Fix backup failure due to missing RBAC
resourceNameson theRoleobject (#2956) -
Observability:
- Add TCP port label to default
pg_stat_replicationmetric (#2961) - Fix the
pg_wal_statdefault metric for Prometheus (#2569) - Improve the
pg_replicationdefault metric for Prometheus (#2744 and #2750) - Use
alertInstanceLabelFilterinstead ofalertNamein the provided Grafana dashboard - Enforce
standard_conforming_stringsin metric collection (#2888)
- Add TCP port label to default
Changes:
- Set the default operand image to PostgreSQL 16.0
- Fencing now uses PostgreSQL's fast shutdown instead of smart shutdown to halt an instance (#3051)
- Rename webhooks from kb.io to cnpg.io group (#2851)
- Replace the
cnpg snapshotcommand withcnpg backup -m volumeSnapshotfor thekubectlplugin - Let the
cnpg hibernateplugin command use theClusterManifestAnnotationNameandPgControldataAnnotationNameannotations on PVCs (#2657) - Add the
cnpg.io/instanceRolelabel while deprecating the existingrolelabel (#2915)
Technical enhancements:
- Replace
k8s-api-docgenwithgen-crd-api-reference-docsto automatically build the API reference documentation (#2606)