- Notifications
You must be signed in to change notification settings - Fork6
CloudNativePG is a Kubernetes operator that covers the full lifecycle of a PostgreSQL database cluster with a primary/standby architecture, using native streaming replication
License
EnterpriseDB/cloudnative-pg
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
CloudNativePG (CNPG) is an open-source platform designed to seamlesslymanagePostgreSQL databases in Kubernetesenvironments. It covers the entire operational lifecycle—from deployment toongoing maintenance—through its core component, the CloudNativePG operator.
The best way to get started is theQuickstart Guide.
CloudNativePG aims to increase PostgreSQL adoption within Kubernetes by makingit an integral part of the development process and GitOps-driven CI/CDautomation.
Designed by PostgreSQL experts for Kubernetes administrators, CloudNativePGfollows a Kubernetes-native approach to PostgreSQL primary/standby clustermanagement. Instead of relying on external high-availability tools (likePatroni, repmgr, or Stolon), it integrates directly with the Kubernetes API toautomate database operations that a skilled DBA would perform manually.
Key design decisions include:
- Direct integration with Kubernetes API: The PostgreSQL cluster’s status isavailable directly in the
Cluster
resource, allowing users to inspect itvia the Kubernetes API. - Operator pattern: The operator ensures that the desired PostgreSQL state isreconciled automatically, following Kubernetes best practices.
- Immutable application containers: Updates follow an immutable infrastructuremodel, as explained in"Why EDB Chose Immutable Application Containers".
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 newprimary, updates the cluster status, and orchestrates the transition.
- Scaling read replicas: When the number of desired replicas changes, theoperator 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, ensuringthat PostgreSQL service endpoints are always up to date.
- Rolling updates: When an image is updated, the operator follows a rollingstrategy—first updating replica pods before performing a controlledswitchover for the primary.
CloudNativePG manages additional Kubernetes resources to enhance PostgreSQLmanagement, including:Backup
,ClusterImageCatalog
,Database
,ImageCatalog
,Pooler
,Publication
,ScheduledBackup
, andSubscription
.
- Kubernetes only: CloudNativePG is dedicated to vanilla Kubernetesmaintained by theCloud Native Computing Foundation(CNCF).
- PostgreSQL only: CloudNativePG is dedicated to vanilla PostgreSQLmaintained by thePostgreSQL Global Development Group(PGDG).
- No support for forks: Features from PostgreSQL forks will only beconsidered if they can be integrated as extensions or pluggable frameworks.
- Not a general-purpose database operator: CloudNativePG does not supportother databases (e.g., MariaDB).
CloudNativePG can be extended via theCNPG-I plugin interface.
A list of publicly known users of the CloudNativePG operator is inADOPTERS.md.Help us grow our community and CloudNativePG by adding yourself and yourorganization to this list!
- April 4 2025, KubeCon Europe in London:"Consistent Volume Group Snapshots, Unraveling the Magic" - Leonardo Cecchi (EDB) and Xing Yang (VMware)
- November 11 2024, Cloud Native Rejekts NA 2024:"Maximising Microservice Databases with Kubernetes, Postgres, and CloudNativePG" - Gabriele Bartolini (EDB) and Leonardo Cecchi (EDB)
- March 21 2024, KubeCon Europe 2024 in Paris:"Scaling Heights: Mastering Postgres Database Vertical Scalability with Kubernetes Storage Magic" - Gari Singh, Google & Gabriele Bartolini, EDB
- March 19 2024, Data on Kubernetes Day at KubeCon Europe 2024 in Paris:"From Zero to Hero: Scaling Postgres in Kubernetes Using the Power of CloudNativePG" - Gabriele Bartolini, EDB
- 7 November 2023, KubeCon North America 2023 in Chicago:"Disaster Recovery with Very Large Postgres Databases (in Kubernetes)" - Michelle Au, Google & Gabriele Bartolini, EDB
- 27 October 2022, KubeCon North America 2022 in Detroit:"Data On Kubernetes, Deploying And Running PostgreSQL And Patterns For Databases In a Kubernetes Cluster" - Chris Milsted, Ondat & Gabriele Bartolini, EDB
- Data on Kubernetes (DoK) Community
- "Cloud Neutral Postgres Databases with Kubernetes and CloudNativePG" by Gabriele Bartolini (November 2024)
- "How to migrate your PostgreSQL database in Kubernetes with ~0 downtime from anywhere" by Gabriele Bartolini (March 2024)
- "Maximizing Microservice Databases with Kubernetes, Postgres, and CloudNativePG" by Gabriele Bartolini (February 2024)
- "Recommended Architectures for PostgreSQL in Kubernetes" by Gabriele Bartolini (September 2023)
- "The Current State of Major PostgreSQL Upgrades with CloudNativePG" by Gabriele Bartolini (August 2023)
- "The Rise of the Kubernetes Native Database" by Jeff Carpenter (December 2022)
- "Why Run Postgres in Kubernetes?" by Gabriele Bartolini (May 2022)
- "Shift-Left Security: The Path To PostgreSQL On Kubernetes" by Gabriele Bartolini (April 2021)
- "Local Persistent Volumes and PostgreSQL usage in Kubernetes" by Gabriele Bartolini (June 2020)
We are aCloud Native Computing Foundation Sandbox project.
CloudNativePG was originally built and sponsored byEDB.
Postgres, PostgreSQL, and the Slonik Logoare trademarks or registered trademarks of the PostgreSQL Community Associationof Canada, and used with their permission.
About
CloudNativePG is a Kubernetes operator that covers the full lifecycle of a PostgreSQL database cluster with a primary/standby architecture, using native streaming replication
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Languages
- Go98.4%
- Shell1.2%
- Other0.4%