mrkeyoor.com_
Tue 01 Sept 17:40 UTC
Dataevaluationupdated 22 Aug 2026

cloudnative-pg review

CloudNativePG is a Kubernetes operator for running PostgreSQL clusters through custom resources. It handles primary and replica lifecycle, failover, rolling updates, services, backups, and related database objects while keeping Kubernetes as the source of desired state.

+18stars / 7d
Verdict

CloudNativePG is a strong choice when Kubernetes is already your operating model and your team wants PostgreSQL expressed through the same API. Its scope, upgrade behavior, and backup transition are documented with refreshing precision. Use it only if you can test storage failures and restores; installing an operator does not transfer database accountability to someone else.

We ran it

Lab card: what happened when we ran cloudnative-pgScreenshot of cloudnative-pg (cloudnative-pg.io)
Install✓ · 55s231 packages
Build✓ · 167s
Tests✗ · 173s85 passed · 1 failed of 86 (go test)
Repo1839 files~217,431 lines of source · 60.5 MB · 21 CI workflows · Dockerfile · tests dir

Answers from our run

Does cloudnative-pg build from source?

Dependencies installed in 55 seconds (231 packages), and the build succeeded in 167 seconds. We cloned commit a95a534 into a clean Debian container with 3 CPUs and no project-specific setup.

Do cloudnative-pg's tests pass?

Not all of them: 85 of 86 passed and 1 failed when we ran the project's own test command (go test). Some failures need services or credentials a bare container does not have.

Who should not use cloudnative-pg?

Teams without Kubernetes: the project explicitly supports only Kubernetes and is not a standalone PostgreSQL manager.

What are the alternatives to cloudnative-pg?

Zalando Postgres Operator, Crunchy Postgres for Kubernetes, StackGres. CloudNativePG is a strong choice when Kubernetes is already your operating model and your team wants PostgreSQL expressed through the same API.

Setup3/5Simple operator install, substantial cluster and storage prerequisites
Docs5/5Detailed guides cover architecture, upgrades, backups, and recovery
Community5/5Same-day development and active issue and pull-request handling
Maturity4/5Production feature set with active backup and election changes

Discussed on

  1. hnCloudNativePG – Postgres Operator for Kubernetes151 points
  2. hnCloudNativePG: Run PostgreSQL, the Kubernetes Way3 points

Who it’s for

Kubernetes platform teams that want PostgreSQL managed through manifests and controllers.
PostgreSQL operators who need automated primary failover, replica scaling, rolling updates, and physical backups.
GitOps teams that want databases, roles, poolers, publications, and scheduled backups represented as Kubernetes resources.
Organizations willing to test their storage, network, restore process, and failure policy before production.

Who it’s NOT for

Teams without Kubernetes: the project explicitly supports only Kubernetes and is not a standalone PostgreSQL manager.
MariaDB, MySQL, or PostgreSQL-fork users: the stated scope is vanilla PostgreSQL, with fork features accepted only through extensions or plugins.
Small applications that want a provider to own database operations: CloudNativePG automates actions, but your team still owns cluster capacity, storage classes, backups, monitoring, and recovery drills.
Operators depending on native Barman Cloud backup support indefinitely: the v1.30.0 notes say it is due for removal in 1.31.0 and recommend the Barman Cloud Plugin.
Production teams treating the quickstart as a deployment recipe: its Kind and Minikube instructions explicitly say they are for testing and practice only.

Setup reality

At commit a95a534, our fresh Debian container installed 231 packages in 55 seconds and built the Go project in 167 seconds. Tests ran for 173 seconds and failed with exit 1: 85 packages passed and 1 failed out of 86. The supplied log tail ends with the package summary and FAIL; it does not identify the failing package or assertion.

A source build is only the operator binary. A useful trial also needs Kubernetes, kubectl, a working storage class, and enough resources for PostgreSQL pods. The quickstart uses Kind or Minikube, then applies the operator and a three-instance Cluster manifest. Production backup adds object-storage credentials and a CNPG-I plugin, or CSI snapshot support.

Platform details matter. The docs warn that private GKE control-plane firewalls may block the webhook port. Operator upgrades trigger instance-manager rolling updates and may switch the primary automatically unless supervised updates are selected. Pin PostgreSQL images to a version or digest instead of broad tags.

PostgreSQL controlled through Kubernetes

CloudNativePG turns a PostgreSQL cluster into a Kubernetes resource. You declare the instance count, storage, PostgreSQL settings, and update policy. The operator creates supporting resources and reacts when the live cluster differs. A failed primary can be replaced by a replica, service endpoints are updated, and image changes roll through replicas before the primary switches.

This design avoids an external high-availability coordinator such as Patroni. Cluster status lives on the Cluster resource, and Kubernetes remains the control plane. The operator also manages databases, roles, poolers, backups, publications, and subscriptions. GitOps teams can review those objects beside application manifests.

CloudNativePG supports Kubernetes and vanilla PostgreSQL. MariaDB and other databases are outside scope, as are PostgreSQL forks unless their additions work as extensions or plugins. Shops seeking one operator for several database engines should walk away.

A quick trial is smaller than production

The quickstart uses Kind or Minikube, installs the operator, and applies a sample three-instance PostgreSQL cluster backed by the default storage class. kubectl is required. The docs reserve this path for practice: a local cluster can show reconciliation and failover, but it says little about production storage latency or restore time.

You can apply a published manifest, generate one with the cnpg plugin, install a Helm chart, or use Operator Lifecycle Manager. The controller normally runs as one deployment replica and supports leader election for multiple replicas.

Private GKE clusters may block control-plane traffic to the validating webhook on port 9443 unless the firewall or service port is adjusted. Database pods need persistent volumes with understood behavior. Production images should use specific versions or digests, since the docs warn against latest and bare major-version tags.

Failover automation still needs an operator

CloudNativePG automates promotion, replica creation, service changes, and controlled primary switches. Version 1.30.0 added a Kubernetes Lease as a mutex for primary promotion. The release notes call it a promotion check rather than fencing. Primary isolation still carries that responsibility.

An operator cannot make unreliable storage reliable or decide your tolerance for data loss. Teams need to test node disappearance, network partitions, and stalled volumes on their platform. An issue updated on 2026-08-21 describes failover blocked when a WAL sender survives on a damaged node. That specific report is reason to test isolation instead of only deleting a healthy pod.

Updating the controller triggers an instance-manager rollout across each cluster. The default unsupervised policy performs the final switchover automatically; supervised mode waits for a manual promotion through the plugin. Pin versions and read the matching release notes before changing them.

Backup choices are operational

CloudNativePG manages physical backup workflows. Logical pg_dump backups are outside its business-continuity path. For object storage, the official direction is the Barman Cloud Plugin through CNPG-I. Native Barman Cloud integration has been deprecated since 1.26, and v1.30.0 says removal moved to 1.31.0. Existing users need a migration task.

Kubernetes volume snapshots are the other main option when the storage class supports them. Object-store backups require WAL archiving and support hot backups. Snapshot behavior depends on the CSI implementation. The docs recommend WAL archiving in production because it enables point-in-time recovery. A WAL archive cannot restore a cluster without a physical base backup.

Object storage can improve portability across environments. Snapshots can restore large volumes quickly, but bind recovery to storage capabilities. Credentials, retention, cross-region access, and restore drills remain the operator's work.

What happened when we ran it

We cloned commit a95a534 into an unprivileged golang:1.24-bookworm container with 3 CPUs and 8 GB of RAM. The repository contained 1,839 files, about 217,431 lines of source, and occupied 60.5 MB. It had 21 CI workflow files, a Dockerfile, and a tests directory.

Installation succeeded in 55 seconds with 231 packages installed. The build succeeded in 167 seconds. Tests ran for 173 seconds and returned exit code 1. The Go summary counted 85 passing packages and 1 failing package out of 86.

The supplied tail shows successful packages under pkg/specs, pkg/system, and several pkg/utils paths, plus packages with no test files. It then ends with FAIL. Since that excerpt does not name the failed package or show its assertion, we cannot explain the failure beyond the aggregate result. The test result prevents a clean-run claim for this commit in our sandbox.

Documentation, releases, and activity

The docs are candid about production limits. The quickstart warns against using its local recipe in production. Installation pages cover firewall problems and rolling updates. Backup docs compare object storage with snapshots and explain the Barman transition.

Version 1.30.0 was released on 2026-06-29. It added declarative database roles, primary election changes, and fixes around backup, bootstrap, storage, certificates, and reconciliation. The last repository push was 2026-08-22, with issues and pull requests updated the same day. GitHub listed 422 open issues and pull requests combined. Activity around snapshots, failover, role management, and backports spans supported release lines.

CloudNativePG reduces handwritten database orchestration. It does not reduce the consequence of getting storage, isolation, or recovery wrong. Teams that accept that division of labor get a capable PostgreSQL operator with clear boundaries.

Alternatives

ProjectWhat it isPick it when
Zalando Postgres OperatorA Kubernetes PostgreSQL operator built around Zalando's Patroni-based stack.pick this instead when your team already knows Patroni and prefers Zalando's cluster conventions and tooling.
Crunchy Postgres for KubernetesA PostgreSQL operator with backup, high availability, and observability integrations from Crunchy Data.pick this instead when Crunchy Data support or its pgBackRest-centered operating model fits your organization.
StackGresA Kubernetes PostgreSQL platform with an operator, web console, and bundled operational components.pick this instead when a browser console and a more bundled administration experience are priorities.

What people are saying

  1. [github-trending] cloudnative-pg/cloudnative-pg

Sources

  1. CloudNativePG repository and README
  2. CloudNativePG quickstart
  3. CloudNativePG installation and upgrades
  4. CloudNativePG backup documentation
  5. CloudNativePG v1.30.0 release
  6. Failover blocked with surviving WAL sender

More data reviews

turso · TrackersListCollection · dash · getcontact-cli · awesome-zhuiju-free · iggy · the whole board →