What is the difference between PGO and a cloud-managed PostgreSQL service like RDS or Cloud SQL?
What is the difference between PGO and a cloud-managed PostgreSQL service like RDS or Cloud SQL?
Can I use my own PostgreSQL container images with PGO?
Can I use my own PostgreSQL container images with PGO?
postgres and pg_ctl binaries must be on the path, pgBackRest must be installed, and Patroni must be available as a Python module. The postgres UID (26) must match what the operator expects.In practice, most users either use the official Crunchy Data images or build a custom image FROM a Crunchy base image and add their additional tooling on top. Building from scratch is possible but requires careful matching of file paths, UID assignments, and installed packages to what PGO expects.You can set a custom image by supplying its full pull spec in spec.image on the PostgresCluster resource.How do I connect to my PostgreSQL cluster from outside Kubernetes?
How do I connect to my PostgreSQL cluster from outside Kubernetes?
ClusterIP service for the primary and, when connection pooling is enabled, a separate service for pgBouncer. Neither is exposed outside the cluster by default.To enable external access, you have three main options:- LoadBalancer service — Add a service override in your
PostgresClusterspec or create a separateServiceof typeLoadBalancerthat selects the primary pod labelpostgres-operator.crunchydata.com/role=master. - NodePort — Expose the existing service on a specific port on every node.
- Kubernetes Ingress or Gateway API — Route TCP traffic through an Ingress controller or Gateway that supports PostgreSQL’s protocol (e.g., nginx with TCP proxying, or a Gateway API implementation with
TCPRoute).
What happens when the PGO operator pod restarts?
What happens when the PGO operator pod restarts?
PostgresCluster custom resource and in standard Kubernetes objects (Secrets, ConfigMaps, StatefulSets, Services). When the operator pod restarts, it re-reads the desired state from those objects and reconciles any drift. Running PostgreSQL clusters are not affected by a transient operator restart.If you run multiple operator replicas with leader election enabled (PGO_CONTROLLER_LEASE_NAME), the active leader can be replaced within a few seconds with no impact on running clusters.Can PGO manage PostgreSQL clusters in multiple namespaces?
Can PGO manage PostgreSQL clusters in multiple namespaces?
PostgresCluster resources in every namespace. You can restrict it to a subset of namespaces using environment variables:PGO_TARGET_NAMESPACE— limits PGO to a single namespace.PGO_TARGET_NAMESPACES— limits PGO to a comma-separated list of namespaces.
How do I perform a manual backup?
How do I perform a manual backup?
spec.backups.pgbackrest.repos[].schedules. To trigger a one-time manual backup outside that schedule, create a PostgresClusterBackup annotation on the cluster or use the pgBackRest stanza management commands directly from inside the backup pod.The most straightforward approach is to exec into the pgbackrest container and run the backup command:What storage class should I use for PostgreSQL data volumes?
What storage class should I use for PostgreSQL data volumes?
ReadWriteOnce PersistentVolumes. For production workloads, prefer a StorageClass backed by local NVMe or network-attached SSD storage that guarantees low latency and consistent IOPS.Recommended starting points by cloud:- AWS EKS —
gp3(the default in most clusters). Preferio1orio2for write-heavy workloads. - GKE —
pd-ssdfor SSD-backed persistent disks. - AKS —
managed-premiumfor Azure Premium SSD. - On-premises — Local path provisioner for single-node clusters; Rook-Ceph, Longhorn, or a commercial SAN driver for multi-node clusters.
AutoGrowVolumes feature gate to automatically expand volumes when they fill up, the StorageClass must have allowVolumeExpansion: true. Check your StorageClass definition:How do I migrate an existing PostgreSQL database to PGO?
How do I migrate an existing PostgreSQL database to PGO?
- Take a base backup of the source database using
pg_basebackuporpg_dump. - For a logical dump: restore it into a PGO-managed cluster using
psqlafter the cluster starts. - For a physical restore: use pgBackRest stanza bootstrapping to seed a new cluster from an external pgBackRest repository.
- Provision a new PGO cluster of the same major PostgreSQL version.
- Set up logical replication from the source to the new cluster.
- Cut traffic over once replication lag is near zero.
- Disable replication and remove the old source.