cloudnative-pg /cloudnative-pg
The most popular Kubernetes Operator for PostgreSQL.
★ 9,598⑂ 819👁 35⑃ 7,374● 3,957▤ 98
+6
Daily
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
#4990[Bug]: Replica does not come up: checkpoint not found in timeline64 comments · 2024-07-01#5778[Feature]: managing cnpg in GitOps workflows (FluxCD, ArgoCD ...)50 comments · 2024-10-09#3680[Bug]: Primary PostgreSQL Instance Not Gracefully Shutting Down and Missing WAL File48 comments · 2024-01-10#5203[Feature]: In-place recovery from backup37 comments · 2024-07-30#6043[Feature]: allow cross-namespace Database and Role configuration35 comments · 2024-11-06#6009[Feature]: VolumeSnapshot retention policy30 comments · 2024-11-01#3242[Feature]: Cluster without default user27 comments · 2023-10-30#7799[Bug]: Node cordon (unschedulable taint) causes a switchover22 comments · 2025-06-10
Discussions
#11920Scheduled restore checks for plugin-barman-cloud backups0 comments · 2026-11-15#11606zabbix-operator: running Zabbix on top of CloudNativePG0 comments · 2026-10-04#11563How do you verify that your CNPG backups actually restore?2 comments · 2026-09-27#11559Freelens extension for CloudNativePG (feedback welcome)0 comments · 2026-09-26#11555Deploying a PG cluster into a different namespace and/or cluster1 comments · 2026-09-24#11478Cancelling CNPG Internal "Order"1 comments · 2026-09-14#11476Is there a practical limit to the number of Postgres Clusters (or resources, pods, etc) that CNPG can manage per operator in a namespace?1 comments · 2026-09-14#11474Ordering of nodes during promotion of a DT cluster0 comments · 2026-09-12
Latest release
v1.30.1 v1.30.1 2026-09-23Release 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