CloudNativePG (CNPG) Kubernetes operator for PostgreSQL. Use when deploying PostgreSQL clusters on Kubernetes, creating Cluster CRDs, configuring PgBouncer connection pooling (Pooler), setting up S3/MinIO backups with Barman Cloud Plugin, WAL archiving, scheduled backups, point-in-time recovery (PITR), declarative role management, Prometheus monitoring, failover/switchover, hibernating clusters, or troubleshooting CNPG issues. Covers single-instance homelab and HA multi-replica patterns with Rook Ceph storage.
Kubernetes operator for PostgreSQL. Shared-nothing architecture: each instance has dedicated storage, managed directly by operator (not StatefulSet).
helm repo add cnpg https://cloudnative-pg.github.io/charts
helm repo update
helm install cnpg cnpg/cloudnative-pg -n cnpg-system --create-namespace
kubectl -n cnpg-system wait --for=condition=ready pod -l app.kubernetes.io/name=cloudnative-pg --timeout=300s
Install kubectl plugin: curl -sSfL https://github.com/cloudnative-pg/cloudnative-pg/raw/main/hack/install-cnpg-plugin.sh | sudo sh -s -- -b /usr/local/bin
apiVersion: postgresql.cnpg.io/v1