CloudNativePG
CloudNativePG is an open source operator
- designed to manage PostgreSQL workloads on any supported
Kubernetes cluster running in private, public, hybrid, or multi-cloud
environments. CloudNativePG adheres to DevOps principles and concepts such as declarative configuration and immutable infrastructure.
It defines a new Kubernetes resource called Cluster representing a
PostgreSQL cluster made up of a single primary and an optional number of
replicas that co-exist in a chosen Kubernetes namespace for High
Availability and offloading of read-only queries.
Applications that reside in the same Kubernetes cluster can access the PostgreSQL database using a service which is solely managed by the operator, without having to worry about changes of the primary role following a failover or a switchover. Applications that reside outside the Kubernetes cluster, need to configure a Service or Ingress object to expose the Postgres via TCP. Web applications can take advantage of the native connection pooler based on PgBouncer.
CloudNativePG was originally built by EDB , then released open source under Apache License 2.0 and submitted for CNCF Sandbox in April 2022. The source code repository is in Github .
Note
Based on the Operator Capability Levels model , users can expect a "Level V - Auto Pilot" set of capabilities from the CloudNativePG Operator.
- Introduction
- Before You Start
- Use cases
- Architecture
- Installation and upgrades
- Installation on Kubernetes
- Details about the deployment
- Upgrades
- In-place updates of the instance manager
- Compatibility among versions
- Upgrading to 1.22.0, 1.21.2 or 1.20.5
- Upgrading to 1.21 from a previous minor version
- Superuser access disabled
- Replication slots for HA
- Delay for PostgreSQL shutdown
- Delay for PostgreSQL startup
- Delay for PostgreSQL switchover
- Labels
- Shortcut for keeping the existing behavior
- Upgrading to 1.20 from a previous minor version
- Backup from a standby
- Restart of a primary after a rolling update
- Replication slots for High Availability
- Quickstart
- Bootstrap
- Importing Postgres databases
- Security
- Postgres instance manager
- Scheduling
- Resource management
- Failure Modes
- Rolling Updates
- Replication
- Backup
- Backup on object stores
- WAL archiving
- Backup on volume snapshots
- Recovery
- PostgreSQL Configuration
- Database Role Management
- Tablespaces
- Operator configuration
- Instance pod configuration
- Volume Claim Template for Temporary Storage
- Storage
- Backup and recovery
- Benchmarking CloudNativePG
- Encryption at rest
- Persistent Volume Claim (PVC)
- Configuration via a storage class
- Configuration via a PVC template
- Volume for WAL
- Volumes for tablespaces
- Volume expansion
- Static provisioning of persistent volumes
- Block storage considerations (Ceph/ Longhorn)
- Labels and annotations
- Monitoring
- Monitoring Instances
- Prometheus Operator example
- Predefined set of metrics
- User defined metrics
- Example of a user defined metric
- Example of a user defined metric running on multiple databases
- Structure of a user defined metric
- Output of a user defined metric
- Default set of metrics
- Differences with the Prometheus Postgres exporter
- Monitoring the operator
- How to inspect the exported metrics
- Auxiliary resources
- Monitoring Instances
- Logging
- Certificates
- Client TLS/SSL connections
- Connecting from an application
- Connection pooling
- Replica clusters
- Kubernetes Upgrade
- Exposing Postgres Services
- Kubectl Plugin
- Install
- Use
- Generation of installation manifests
- Status
- Promote
- Certificates
- Restart
- Reload
- Maintenance
- Report
- report Operator
- report Cluster
- Logs
- Cluster logs
- Destroy
- Cluster hibernation
- Benchmarking the database with pgbench
- Benchmarking the storage with fio
- Requesting a new physical backup
- Launching psql
- Snapshotting a Postgres cluster
- Using pgAdmin4 for evaluation/demonstration purposes only
- Integration with K9s
- Automated failover
- Troubleshooting
- Fencing
- Declarative hibernation
- PostGIS
- End-to-End Tests
- Container Image Requirements
- Operator capability levels
- Level 1: Basic install
- Operator deployment via declarative configuration
- PostgreSQL cluster deployment via declarative configuration
- Override of operand images through the CRD
- Labels and annotations
- Self-contained instance manager
- Storage configuration
- Replica configuration
- Database configuration
- Configuration of Postgres roles, users, and groups
- Pod security policies
- Affinity
- Topology spread constraints
- Command-line interface
- Current status of the cluster
- Operator’s certification authority
- Cluster’s certification authority
- TLS connections
- Certificate authentication for streaming replication
- Continuous configuration management
- Import of existing PostgreSQL databases
- PostGIS clusters
- Basic LDAP authentication for PostgreSQL
- Multiple installation methods
- Convention over configuration
- Level 2: Seamless upgrades
- Level 3: Full lifecycle
- PostgreSQL WAL archive
- PostgreSQL backups
- Backups from a standby
- Full restore from a backup
- Point-in-time recovery (PITR) from a backup
- Zero-data-loss clusters through synchronous replication
- Replica clusters
- Tablespace support
- Liveness and readiness probes
- Rolling deployments
- Scale up and down of replicas
- Maintenance window and PodDisruptionBudget for Kubernetes nodes
- Fencing
- Hibernation (declarative)
- Hibernation (imperative)
- Reuse of persistent volumes storage in pods
- CPU and memory requests and limits
- Connection pooling with PgBouncer
- Level 4: Deep insights
- Level 5: Auto pilot
- Level 1: Basic install
- Custom Pod Controller
- Examples
- Networking
- Benchmarking
- Commercial support
- Frequently Asked Questions (FAQ)
- Resource Types
- Backup
- Cluster
- Pooler
- ScheduledBackup
- AffinityConfiguration
- AzureCredentials
- BackupConfiguration
- BackupMethod
- BackupPhase
- BackupSnapshotElementStatus
- BackupSnapshotStatus
- BackupSource
- BackupSpec
- BackupStatus
- BackupTarget
- BarmanCredentials
- BarmanObjectStoreConfiguration
- BootstrapConfiguration
- BootstrapInitDB
- BootstrapPgBaseBackup
- BootstrapRecovery
- CertificatesConfiguration
- CertificatesStatus
- ClusterSpec
- ClusterStatus
- CompressionType
- ConfigMapKeySelector
- ConfigMapResourceVersion
- DataBackupConfiguration
- DataSource
- DatabaseRoleRef
- EmbeddedObjectMetadata
- EncryptionType
- EnsureOption
- EphemeralVolumesSizeLimitConfiguration
- ExternalCluster
- GoogleCredentials
- Import
- ImportSource
- InstanceID
- InstanceReportedState
- LDAPBindAsAuth
- LDAPBindSearchAuth
- LDAPConfig
- LDAPScheme
- LocalObjectReference
- ManagedConfiguration
- ManagedRoles
- Metadata
- MonitoringConfiguration
- NodeMaintenanceWindow
- OnlineConfiguration
- PasswordState
- PgBouncerIntegrationStatus
- PgBouncerPoolMode
- PgBouncerSecrets
- PgBouncerSpec
- PodTemplateSpec
- PodTopologyLabels
- PoolerIntegrations
- PoolerMonitoringConfiguration
- PoolerSecrets
- PoolerSpec
- PoolerStatus
- PoolerType
- PostInitApplicationSQLRefs
- PostgresConfiguration
- PrimaryUpdateMethod
- PrimaryUpdateStrategy
- RecoveryTarget
- ReplicaClusterConfiguration
- ReplicationSlotsConfiguration
- ReplicationSlotsHAConfiguration
- RoleConfiguration
- S3Credentials
- ScheduledBackupSpec
- ScheduledBackupStatus
- SecretKeySelector
- SecretVersion
- SecretsResourceVersion
- ServiceAccountTemplate
- SnapshotOwnerReference
- SnapshotType
- StorageConfiguration
- SyncReplicaElectionConstraints
- TablespaceConfiguration
- TablespaceState
- TablespaceStatus
- Topology
- VolumeSnapshotConfiguration
- WalBackupConfiguration
- Supported releases
- Release notes
- Appendix A