cloudnative-pg is a free, open source databases project written in Go and released under Apache-2.0. It has 9,321 GitHub stars, 764 forks and 444 open issues, and was last pushed 4 hours ago. On this registry it ranks #86 of 143 tracked projects in Databases, with 5 head-to-head comparisons available.

What is cloudnative-pg?

CloudNativePG is an open-source operator, written in Go under the Apache-2.0 licence, that manages the full operational lifecycle of PostgreSQL clusters inside Kubernetes for platform teams and Kubernetes administrators.

What it is

CloudNativePG (CNPG) is an open-source platform for running PostgreSQL on Kubernetes, built around a single core component, the CloudNativePG operator. It takes a Kubernetes-native approach to primary and standby cluster management, talking directly to the Kubernetes API and reconciling the cluster toward its declared desired state instead of relying on an external high-availability tool. Cluster status lives in the Cluster resource and is inspectable through the Kubernetes API. Updates follow the operator pattern and an immutable application container model.

The problem it solves is the set of manual operations a skilled DBA would otherwise perform. Failover, replica provisioning, endpoint maintenance, and image upgrades are automated. It replaces external high-availability tools such as Patroni, repmgr, and Stolon, which sit outside the Kubernetes API and need separate coordination. CloudNativePG folds that coordination into the control plane, so Kubernetes stays the single source of truth for service endpoints and cluster state.

Key capabilities

  • Automated failover: when the primary instance fails, the operator elects a new primary, updates cluster status, and orchestrates the transition.
  • Reconciliation through the operator pattern, with state exposed in the Cluster resource and readable via the Kubernetes API.
  • Read replica scaling: when the desired replica count changes, the operator provisions or removes persistent volumes, secrets, and config maps while managing streaming replication.
  • Rolling updates under an immutable application container model, updating replica pods first and then performing a controlled switchover for the primary.
  • Additional managed resources: Backup, ScheduledBackup, ClusterImageCatalog, ImageCatalog, Database, Pooler, Publication, and Subscription.
  • A kubectl plugin and JSON logging, both listed among the project topics.

Who uses it and how

  • Kubernetes administrators who need production PostgreSQL high availability without running Patroni, repmgr, or Stolon alongside the cluster.
  • Platform and DevOps teams that treat database configuration as manifests and drive it through GitOps-based CI/CD automation, which the project names as part of its mission.
  • Teams with business continuity and disaster recovery requirements, using Backup and ScheduledBackup resources.
  • Operators scaling read capacity by changing the desired replica count and letting the operator create or remove the supporting persistent volumes, secrets, and config maps.

Getting started

The README directs new users to the Quickstart Guide at https://cloudnative-pg.io/docs/devel/quickstart/, and release artifacts are published through the project's Artifact Hub repository, cloudnative-pg.

How it compares

The facts provide no list of paid products that CloudNativePG replaces; the comparables named in the README are the open-source tools it displaces, namely Patroni, repmgr, and Stolon. Those run alongside PostgreSQL as external high-availability components, whereas CloudNativePG integrates directly with the Kubernetes API and removes that extra component. The other difference is scope: the external tools address failover, while CloudNativePG also covers replica scaling, service endpoint updates, and rolling image upgrades.

When to use it — and when not to

A self-hoster must already run Kubernetes, because the project is explicitly scoped to Kubernetes only, and must operate the CNPG operator and its PostgreSQL cluster resources themselves. Teams outside Kubernetes, or those wanting a fully managed database service, should not pick it. The repository is active, with a push as recent as 2026-09-18 and a clear Apache-2.0 licence, but it carries 444 open issues and the published README excerpt is thin on upgrade paths and production caveats, so the full documentation is worth reading before adoption.

project readme (upstream, from github) — read inline

[CNCF Landscape][cncf-landscape] [Latest Release][latest-release] [GitHub License][license] [OpenSSF Best Practices][openssf] [OpenSSF Baseline][openssf] [![OpenSSF Scorecard Badge][openssf-scorecard-badge]][openssf-socrecard-view] [![Documentation][documentation-badge]][documentation] [Stack Overflow][stackoverflow] [![FOSSA Status][fossa-badge]][fossa] CLOMonitor Artifact Hub

Welcome to the CloudNativePG Project!

CloudNativePG (CNPG) is an open-source platform designed to seamlessly manage PostgreSQL databases in Kubernetes environments. It covers the entire operational lifecycle—from deployment to ongoing maintenance—through its core component, the CloudNativePG operator.

Table of Contents

Getting Started

The best way to get started is the Quickstart Guide.

Scope

Mission

CloudNativePG aims to increase PostgreSQL adoption within Kubernetes by making it an integral part of the development process and GitOps-driven CI/CD automation.

Core Principles & Features

Designed by PostgreSQL experts for Kubernetes administrators, CloudNativePG follows a Kubernetes-native approach to PostgreSQL primary/standby cluster management. Instead of relying on external high-availability tools (like Patroni, repmgr, or Stolon), it integrates directly with the Kubernetes API to automate database operations that a skilled DBA would perform manually.

Key design decisions include:

  • Direct integration with Kubernetes API: The PostgreSQL cluster’s status is available directly in the Cluster resource, allowing users to inspect it via the Kubernetes API.
  • Operator pattern: The operator ensures that the desired PostgreSQL state is reconciled automatically, following Kubernetes best practices.
  • Immutable application containers: Updates follow an immutable infrastructure model, as explained in "Why EDB Chose Immutable Application Containers".

How CloudNativePG Works

The operator continuously monitors and updates the PostgreSQL cluster state. Examples of automated actions include:

  • Failover management: If the primary instance fails, the operator elects a new primary, updates the cluster status, and orchestrates the transition.
  • Scaling read replicas: When the number of desired replicas changes, the operator provisions or removes resources such as persistent volumes, secrets, and config maps while managing streaming replication.
  • Service updates: Kubernetes remains the single source of truth, ensuring that PostgreSQL service endpoints are always up to date.
  • Rolling updates: When an image is updated, the operator follows a rolling strategy—first updating replica pods before performing a controlled switchover for the primary.

CloudNativePG manages additional Kubernetes resources to enhance PostgreSQL management, including: Backup, ClusterImageCatalog, Database, ImageCatalog, Pooler, Publication, ScheduledBackup, and Subscription.

Out of Scope

  • Kubernetes only: CloudNativePG is dedicated to vanilla Kubernetes maintained by the Cloud Native Computing Foundation (CNCF).
  • PostgreSQL only: CloudNativePG is dedicated to vanilla PostgreSQL maintained by the PostgreSQL Global Development Group (PGDG).
  • No support for forks: Features from PostgreSQL forks will only be considered if they can be integrated as extensions or pluggable frameworks.
  • Not a general-purpose database operator: CloudNativePG does not support other databases (e.g., MariaDB).

CloudNativePG can be extended via the CNPG-I plugin interface.

Communications

Please refer to the Getting in touch section on the GitHub organization page.

Community Meetings

Everyone is welcome, no invitation needed. For details, see the Community Meetings section on the GitHub organization page.

Resources

Adopters

A list of publicly known users of the CloudNativePG operator is in ADOPTERS.md. Help us grow our community and CloudNativePG by adding yourself and your organization to this list!

CloudNativePG at KubeCon

readme truncated — read the full docs on github

Frequently asked questions

Is cloudnative-pg free to use?

cloudnative-pg is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does cloudnative-pg do?

The most popular Kubernetes Operator for PostgreSQL.

What is cloudnative-pg written in?

cloudnative-pg is primarily written in Go. Its source is publicly available at https://github.com/cloudnative-pg/cloudnative-pg, and it has 9,321 GitHub stars.