cloudnative-pg /cloudnative-pg

The most popular Kubernetes Operator for PostgreSQL.

★ 9,598⑂ 819👁 35⑃ 7,374● 3,957▤ 98
GoApache-2.0Created 2022-03-10cloudnative-pg.io
下载:v1.30.1v1.30.1 ↓1.30.12026-09-23
+6
日增长
9,598
stars
819
forks
35
watchers
7,374
prs
3,957
issues
98
releases

README

![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]



 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

- Code of Conduct
- Governance Policies
- Contributing
- Adopters
- Commercial Support
- License

 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

- K

Top issues

Discussions

Latest release

v1.30.1 v1.30.1 2026-09-23
Release date: Sep 23, 2026

 Enhancements

  - Added restoreAdditionalCommandArgs to .barmanObjectStore.data for in-tree Barman Cloud recoveries, so custom flags are forwarded to barman-cloud-restore during recovery. (\11278) 

  - Plugin authors no longer need to re-derive whether an empty WAL archive should be treated as an error: the operator now computes the check_empty_wal_archive decision once and passes it to CNPG-I plugins on both WAL archiving and restore hooks. (\11216) 

  - Allowed setting the ssl_ecdh_curve PostgreSQL parameter in .spec.postgresql.parameters. It was previously rej

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON