CloudNativePG is a Kubernetes operator that manages the full lifecycle of PostgreSQL clusters: provisioning, replication, failover, rolling updates, backups and recovery. It addresses the long-standing difficulty of running a stateful, primary-standby database on Kubernetes, which previously relied on external high-availability tools such as Patroni, repmgr or Stolon layered onto StatefulSets. EDB built the operator internally as Cloud Native PostgreSQL and released it in May 2022 as an openly governed open source project under the name CloudNativePG. It was accepted into the CNCF at the Sandbox level on January 21, 2025, and moved to Incubating on November 2, 2026 (announced November 10, 2026).
CNCF daily · Sprint 2, day 2 · Database
At a glance
| Category | App Definition and Development › Database |
| CNCF status | Incubating. Accepted January 21, 2025 (Sandbox); moved to Incubating November 2, 2026 |
| Written in | Go |
| License | Apache 2.0 |
| Scope | Vanilla PostgreSQL on vanilla Kubernetes; forks and other databases are out of scope |
| Key resources | Cluster, Pooler, Backup, ScheduledBackup, Database, Publication, Subscription, ImageCatalog |
| Recent milestone | 1.28 (December 9, 2025): quorum-based failover stable, PostgreSQL 18 default |
Architecture
Blue is the client, slate the connection path and the operator, purple the PostgreSQL pods and teal the backup storage. Each instance has its own persistent volume claim, which is not drawn. The operator manages pods and volumes directly rather than through a StatefulSet. Open the zoomable diagram, or download it as SVG or PNG.
| Component | Responsibility |
|---|---|
| Applications | Connect with ordinary PostgreSQL clients. |
| Pooler | Optional PgBouncer deployment managed by the operator for connection pooling. |
| Services | -rw always points at the primary and -ro at the standbys; failover updates the endpoints. A -r Service points at any instance and is not drawn. |
| Primary and standbys | PostgreSQL pods, each started by the instance manager. The primary streams WAL to the standbys. |
| Operator | Watches Cluster resources and manages pods and persistent volume claims directly, controlling the order of failover, switchover and upgrades. |
| Object storage | Receives continuous WAL archiving and base backups from the Barman Cloud plugin, enabling point-in-time recovery on S3, Azure Blob Storage or Google Cloud Storage. |
Design principle. The Kubernetes API is the source of truth for cluster state. Instead of an external consensus system deciding who is primary, the operator and instance managers use Kubernetes resources and status, which keeps the architecture small and observable with standard Kubernetes tools.
A write, its replication and its archive
- Connect. The application sends SQL to the pooler, or directly to a Service.
- Route writes. Write connections go to the
-rwService. - Reach the primary. The
-rwService forwards to the current primary. - Route reads. Read-only connections go to the
-roService. - Reach a standby. The
-roService forwards to a standby. - Replicate. The primary streams WAL to the standbys.
- Archive. The Barman Cloud plugin archives WAL and base backups to object storage.
- Reconcile. The operator keeps pods and volumes matching the
Cluster, and promotes a standby if the primary fails.
Steps 1 to 5 serve each query; steps 6 to 8 run continuously.
Open the zoomable flow diagram, or download it as SVG or PNG.
Production reference design
A typical deployment on EKS, GKE, AKS or on-premises uses three instances across availability zones, backups to object storage and a pooler in front.
- Install the operator with the official Helm chart:
Install cert-manager and the Barman Cloud plugin as well; backups are moving from the operator’s in-tree support to the plugin, and the in-tree implementation is scheduled for removal in a future minor release.helm repo add cnpg https://cloudnative-pg.github.io/charts helm upgrade --install cnpg cnpg/cloudnative-pg \ --namespace cnpg-system --create-namespace - Define the backup target as an
ObjectStore, using workload identity (IRSA on EKS) rather than static keys. - Create the cluster, spread across zones, with synchronous replication for zero data loss on failover:
apiVersion: barmancloud.cnpg.io/v1 kind: ObjectStore metadata: name: s3-backups spec: retentionPolicy: "30d" configuration: destinationPath: s3://acme-pg-backups/shop s3Credentials: inheritFromIAMRole: true wal: compression: gzip --- apiVersion: postgresql.cnpg.io/v1 kind: Cluster metadata: name: shop-db spec: instances: 3 imageName: ghcr.io/cloudnative-pg/postgresql:18 storage: size: 100Gi storageClass: gp3 postgresql: parameters: shared_buffers: "2GB" max_connections: "300" synchronous: method: any number: 1 affinity: topologyKey: topology.kubernetes.io/zone resources: requests: { cpu: "2", memory: 8Gi } limits: { memory: 8Gi } monitoring: enablePodMonitor: true plugins: - name: barman-cloud.cloudnative-pg.io isWALArchiver: true parameters: barmanObjectName: s3-backups --- apiVersion: postgresql.cnpg.io/v1 kind: ScheduledBackup metadata: name: shop-db-nightly spec: schedule: "0 0 21 * * *" cluster: name: shop-db method: plugin pluginConfiguration: name: barman-cloud.cloudnative-pg.io - Add a Pooler with PgBouncer in transaction mode for applications that open many short connections.
- Observe with the built-in Prometheus metrics, the community Grafana dashboard and the
kubectl cnpgplugin (kubectl cnpg status shop-db). - Rehearse recovery by bootstrapping a new cluster from the object store to a target time, and by running a planned switchover with
kubectl cnpg promote.
Typical production uses are application databases for microservices, multi-tenant platforms providing PostgreSQL as a service on Kubernetes, and replica clusters in a second region for disaster recovery.
Operational considerations
- Scaling: scale reads by adding instances and pointing read traffic at the
-roservice; writes scale vertically. Use a Pooler before raisingmax_connections. - High availability: spread instances across zones, use synchronous replication where data loss is unacceptable, and protect pods with the PodDisruptionBudgets the operator creates. Quorum-based failover (stable since 1.28) reduces the risk of promoting a standby that missed committed transactions.
- Security: TLS is enabled by default with operator-managed certificates; integrate cert-manager for your own CA. Store application credentials in the generated Secrets, rotate them, and restrict
pg_hbarules. - Cost and sizing: storage performance drives database performance; prefer gp3 or premium SSD classes with provisioned IOPS for busy clusters, and separate WAL volumes for write-heavy workloads.
- Common pitfalls: untested backups, missing WAL archiving (which blocks point-in-time recovery), node pools without spread across zones, and storage classes that cannot expand volumes. Plan the migration from in-tree Barman backups to the plugin before upgrading to the release that removes them.
Adoption
The project’s end-user page lists organisations including EDB, Tembo, ParadeDB, REWE International AG, Docaposte, Mirakl, Hitachi, the Rubin Observatory and pgEdge, and further adopters are recorded in the repository’s ADOPTERS file. EDB states that the project has dozens of adopters including all major cloud providers, and vendors such as Percona and pgEdge offer support or distributions based on it.
Alternatives
| Solution | Model | Best suited to |
|---|---|---|
| Managed PostgreSQL (Amazon RDS and Aurora, Cloud SQL, Azure Database) | Fully managed service outside Kubernetes | Teams that prefer to buy database operations |
| Zalando Postgres Operator | Operator using Patroni on StatefulSets | Existing Patroni users |
| Crunchy Postgres for Kubernetes (PGO) | Operator with Patroni and pgBackRest | Organisations wanting Crunchy Data support |
| StackGres | Operator with a web console and integrated stack | Teams wanting a bundled UI |
| Self-managed VMs with Patroni | Traditional HA outside Kubernetes | Databases intentionally kept off the cluster |
Strengths and limitations
| Strengths | Limitations |
|---|---|
| No external HA dependency; failover driven by Kubernetes state | Running databases on Kubernetes still demands storage and operations expertise |
| Declarative backups, PITR and replica clusters | Incubating since November 2026; governance model and APIs are still evolving |
| Strong defaults: TLS, metrics, PodDisruptionBudgets | Backup architecture is in transition to the plugin model |
| Active release cadence and broad vendor support | Vanilla PostgreSQL only; no support for forks |
| Plugin interface (CNPG-I) for extensions | Write scaling remains vertical, as with any single-primary PostgreSQL |
Recommendation
Trial for teams that already run stateful workloads on Kubernetes and want PostgreSQL alongside their applications, especially for on-premises or multi-cloud platforms. Start with a three-instance cluster across zones, the Barman Cloud plugin to object storage, and regular restore drills before moving critical data. Teams without Kubernetes storage experience, or with a managed database already in place, should keep the managed service.
References: CNCF project page · CloudNativePG documentation · Release notes for 1.28 · CNCF Incubating announcement · EDB announcement of the CNCF Sandbox milestone · End users · CloudNativePG on GitHub

