Full field reference for the PostgresCluster CRD (v1beta1): instances, backups, proxy, monitoring, TLS, authentication, users, and status fields.
The PostgresCluster custom resource is the primary API for PGO. It defines a complete, production-grade PostgreSQL cluster including instance sets, backup repositories, connection pooling, monitoring, and high availability. PGO continuously reconciles the cluster to match the desired state you declare in this resource.API group:postgres-operator.crunchydata.com/v1beta1Kind:PostgresClusterScope: Namespaced
The apiVersion must be postgres-operator.crunchydata.com/v1beta1. The example in the PGO source repository uses postgres-operator.crunchydata.com/v1 — always use v1beta1 for current deployments.
One or more sets of PostgreSQL pods that replicate data for this cluster. At least one instance set must be defined. Each set is backed by a StatefulSet. Multiple instance sets allow you to place replicas on different node pools or availability zones.
Unique name for this instance set within the cluster. Optional when only one instance set is defined. The combined length of the cluster name and this value must be 46 characters or less. Defaults to a zero-padded index (e.g. 00).Pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?)?$
Optional separate PersistentVolumeClaim for PostgreSQL’s write-ahead log (WAL). Separating WAL onto its own volume can improve I/O performance on high-write workloads.
List of tablespace volumes to mount. Each entry requires a name (lowercase alphanumeric, starting with a letter) and a dataVolumeClaimSpec. Requires the TablespaceVolumes feature gate to be enabled. See feature gates.
Up to 10 additional pre-existing PVC or OCI image volumes. Each entry requires a name and either a claimName or image. Volumes are mounted at /volumes/{name} in containers.
List of pgBackRest repositories. At least one repository is required. Each repository must have a unique name matching the pattern ^repo[1-4] (i.e. repo1, repo2, repo3, or repo4). Exactly one storage type must be specified per repo.
Global pgBackRest configuration settings. These are merged into the [global] section of the generated pgBackRest configuration, mounted at /etc/pgbackrest/conf.d.
Trigger a manual (unscheduled) backup. Set repoName to the target repo and add the annotation postgres-operator.crunchydata.com/pgbackrest-backup with a unique ID to initiate.
In-place restore configuration. Set enabled: true along with repoName and optional options to trigger a restore. Requires the cluster to be paused first.
In-place restores overwrite the existing cluster data. Always verify your backup before initiating a restore.
Files to mount under /etc/pgbouncer. Settings in pgbouncer.ini are loaded first. Changes to references cause pgBouncer to restart; changes to file contents are automatically reloaded.
Custom exporter configuration volumes. If a queries.yml file is detected, it is loaded via the --extend.query-path flag. Changing this value causes PostgreSQL and the exporter to restart.
Bootstrap from a cloud-based pgBackRest repository (S3, GCS, or Azure). Incompatible with postgresCluster. Requires repo (without a volume type), stanza, and optional global settings and options.
Bootstrap from an existing PostgresCluster’s pgBackRest repository. Requires repoName. Defaults to the same cluster name and namespace if clusterName and clusterNamespace are omitted.
Reuse existing PVCs from a previous cluster. Supports pgDataVolume, pgWALVolume, and pgBackRestVolume. Each requires a pvcName and an optional directory.
When reusing volumes, the pgWALVolume must be accompanied by pgDataVolume.
PostgreSQL runtime parameters (from postgresql.conf). Keys are parameter names and values are their settings. Maximum 50 entries. Some values reload without restart; others require a restart. Some parameters cannot be changed.
The following parameters are managed by PGO and cannot be set: listen_addresses, port, ssl, wal_log_hints, hot_standby, archive_mode, archive_command, logging_collector, cluster_name, and replication parameters. Setting wal_level is restricted to logical or higher.
PostgreSQL host-based authentication (pg_hba.conf) rules. Rules are evaluated in order; the first match determines the authentication method. Connections matching no rule are rejected.When omitted or empty, PostgreSQL accepts encrypted network connections from users with a password.
Secret projection supplying a custom server TLS certificate for PostgreSQL connections. The secret must contain tls.crt, tls.key, and ca.crt keys.When provided, customReplicationTLSSecret must also be provided, and both secrets must share the same CA certificate.
See the TLS guide for instructions on bringing your own certificates.
Secret projection supplying the replication client TLS certificate. Required when customTLSSecret is set. Must contain tls.crt, tls.key, and ca.crt keys with the same CA as customTLSSecret.
Users to create inside PostgreSQL and the databases they should access. Maximum 64 users. The default creates one user matching the cluster name with access to a database of the same name. An empty list creates no users.
Removing a user from this list does not drop the user or revoke their access in PostgreSQL.
Container image for PostgreSQL. When omitted, the operator uses an environment variable named RELATED_IMAGE_POSTGRES_{postgresVersion} (e.g. RELATED_IMAGE_POSTGRES_16). For PostGIS images, the format is RELATED_IMAGE_POSTGRES_{version}_GIS_{postgisVersion}.
When true, disables the operator’s default pod scheduling constraints and uses only the custom constraints you provide. When false or unset, default constraints are applied in addition to any custom ones.
Group IDs added to every container in the cluster. Useful when accessing shared file systems with restricted permissions. Values must be between 1 and 2147483647.
When true, scales all workloads to zero and suspends CronJobs. Services and Volumes remain in place. The cluster can be restarted by setting this to false.