Skip to content

Custom Resource options

The Cluster is configured via the deploy/cr.yaml file.

The metadata part of this file contains the following keys:

  • name (cluster1 by default) sets the name of your Percona Distribution for PostgreSQL Cluster; it should include only URL-compatible characters, not exceed 22 characters, start with an alphabetic character, and end with an alphanumeric character;

The spec part of the deploy/cr.yaml file contains the following sections:

Key Value type Default Description
pause boolean false Pause/resume: setting it to true gracefully stops the cluster, and setting it to false after shut down starts the cluster back.
upgradeOptions subdoc Percona Distribution for PostgreSQL upgrade options section
pgPrimary subdoc PostgreSQL Primary instance options section
walStorage subdoc Tablespaces Storage Section
walStorage subdoc Write-ahead Log Storage Section
backup subdoc Section to configure backups and pgBackRest
pmm subdoc Percona Monitoring and Management section
pgBouncer subdoc The pgBouncer connection pooler section
pgReplicas subdoc Section required to manage the replicas within a PostgreSQL cluster
pgBadger subdoc The pgBadger PostgreSQL log analyzer section
Key database
Value string
Example pgdb
Description The name of a database that the PostgreSQL user can log into after the PostgreSQL cluster is created
Key disableAutofail
Value boolean
Example false
Description Turns high availability on or off. By default, every cluster can have high availability if there is at least one replica
Key tlsOnly
Value boolean
Example false
Description Enforece Operator to use only Transport Layer Security (TLS) for both internal and external communications
Key sslCA
Value string
Example cluster1-ssl-ca
Description The name of the secret with TLS used for both connection encryption (external traffic), and replication (internal traffic)
Key secretsName
Value string
Example cluster1-secrets
Description The name of the secret created to store credentials for system users
Key sslSecretName
Value string
Example cluster1-ssl-keypair
Description The name of the secret created to encrypt external communications
Key sslReplicationSecretName
Value string
Example cluster1-ssl-keypair"
Description The name of the secret created to encrypt internal communications
Key keepData
Value boolean
Example true
Description If true, PVCs will be kept after the cluster deletion
Key keepBackups
Value boolean
Example true
Description If true, local backups will be kept after the cluster deletion
Key pgDataSource.restoreFrom
Value string
Example ""
Description The name of a data source PostgreSQL cluster, which is used to restore backup to a new cluster
Key pgDataSource.restoreOpts
Value string
Example ""
Description Custom pgBackRest options to restore backup to a new cluster

Upgrade Options Section

The upgradeOptions section in the deploy/cr.yaml file contains various configuration options to control Percona Distribution for PostgreSQL upgrades.

Key upgradeOptions.versionServiceEndpoint
Value string
Example https://check.percona.com
Description The Version Service URL used to check versions compatibility for upgrade
Key upgradeOptions.apply
Value string
Example disabled
Description Specifies how updates are processed by the Operator. Never or Disabled will completely disable automatic upgrades, otherwise it can be set to Latest or Recommended or to a specific version number of Percona Distribution for PostgreSQL to have it version-locked (so that the user can control the version running, but use automatic upgrades to move between them).
Key upgradeOptions.schedule
Value string
Example 0 2 \* \* \*
Description Scheduled time to check for updates, specified in the crontab format

pgPrimary Section

The pgPrimary section controls the PostgreSQL Primary instance.

Key pgPrimary.image
Value string
Example perconalab/percona-postgresql-operator:main-ppg13-postgres-ha
Description The Docker image of the PostgreSQL Primary instance
Key pgPrimary.imagePullPolicy
Value string
Example Always
Description This option is used to set the policy for updating pgPrimary and pgReplicas images
Key pgPrimary.resources.requests.memory
Value int
Example 256Mi
Description The Kubernetes memory requests for a PostgreSQL Primary container
Key pgPrimary.resources.requests.cpu
Value string
Example 500m
Description Kubernetes CPU requests for a PostgreSQL Primary container
Key pgPrimary.resources.limits.cpu
Value string
Example 500m
Description Kubernetes CPU limits for a PostgreSQL Primary container
Key pgPrimary.resources.limits.memory
Value string
Example 256Mi
Description The Kubernetes memory limits for a PostgreSQL Primary container
Key pgPrimary.affinity.antiAffinityType
Value string
Example preferred
Description Pod anti-affinity type, can be either preferred or required
Key pgPrimary.affinity.nodeAffinityType
Value string
Example preferred
Description Node affinity type, can be either preferred or required
Key pgPrimary.affinity.nodeLabel
Value label
Example kubernetes.io/region: us-central1
Description Set labels for PostgreSQL instances Node affinity
Key pgPrimary.affinity.advanced
Value subdoc
Example
Description Allows using standard Kubernetes affinity constraints for advanced affinity and anti-affinity tuning
Key pgPrimary.volumeSpec.size
Value int
Example 1G
Description The Kubernetes PersistentVolumeClaim size for the PostgreSQL Primary storage
Key pgPrimary.tolerations
Value subdoc
Example node.alpha.kubernetes.io/unreachable
Description Kubernetes Pod tolerations
Key pgPrimary.volumeSpec.size
Value int
Example 1G
Description The Kubernetes PersistentVolumeClaim size for the PostgreSQL Primary storage
Key pgPrimary.volumeSpec.accessmode
Value string
Example ReadWriteOnce
Description The Kubernetes PersistentVolumeClaim access modes for the PostgreSQL Primary storage
Key pgPrimary.volumeSpec.storagetype
Value string
Example dynamic
Description Type of the PostgreSQL Primary storage provisioning: create (the default variant; used if storage is provisioned, e.g. using hostpath) or dynamic (for a dynamic storage provisioner, e.g. via a StorageClass)
Key pgPrimary.volumeSpec.storageclass
Value string
Example ""
Description Optionally sets the Kubernetes storage class to use with the PostgreSQL Primary storage PersistentVolumeClaim
Key pgPrimary.volumeSpec.matchLabels
Value string
Example ""
Description A PostgreSQL Primary storage label selector
Key pgPrimary.imagePullPolicy
Value string
Example Always
Description This option is used to set the policy for updating pgPrimary and pgReplicas images
Key pgPrimary.expose.serviceType
Value string
Example ClusterIP
Description Specifies the type of Kubernetes Service for pgPrimary
Key pgPrimary.expose.loadBalancerIP
Value string
Example 127.0.0.1
Description The static IP-address for the load balancer
Key pgPrimary.expose.loadBalancerSourceRanges
Value string
Example "10.0.0.0/8"
Description The range of client IP addresses from which the load balancer should be reachable (if not set, there is no limitations)
Key pgPrimary.expose.annotations
Value label
Example pg-cluster-annot: cluster1
Description The Kubernetes annotations metadata for pgPrimary
Key pgPrimary.expose.labels
Value label
Example pg-cluster-label: cluster1
Description Set labels for the pgPrimary Service
Key pgPrimary.customconfig
Value string
Example ""
Description Name of the Custom configuration options ConfigMap for PostgreSQL cluster

Tablespaces Storage Section

The tablespaceStorages section in the deploy/cr.yaml file contains configuration options for PostgreSQL Tablespace.

Key tablespaceStorages.<storage-name>.volumeSpec.size
Value int
Example 1G
Description The Kubernetes PersistentVolumeClaim size for the PostgreSQL Tablespaces storage
Key tablespaceStorages.<storage-name>.volumeSpec.accessmode
Value string
Example ReadWriteOnce
Description The Kubernetes PersistentVolumeClaim access modes for the PostgreSQL Tablespaces storage
Key tablespaceStorages.<storage-name>.volumeSpec.storagetype
Value string
Example dynamic
Description Type of the PostgreSQL Tablespaces storage provisioning: create (the default variant; used if storage is provisioned, e.g. using hostpath) or dynamic (for a dynamic storage provisioner, e.g. via a StorageClass)
Key tablespaceStorages.<storage-name>.volumeSpec.storageclass
Value string
Example ""
Description Optionally sets the Kubernetes storage class to use with the PostgreSQL Tablespaces storage PersistentVolumeClaim
Key tablespaceStorages.<storage-name>.volumeSpec.matchLabels
Value string
Example ""
Description A PostgreSQL Tablespaces storage label selector

Write-ahead Log Storage Section

The walStorage section in the deploy/cr.yaml file contains configuration options for PostgreSQL write-ahead logging.

Key walStorage.volumeSpec.size
Value int
Example 1G
Description The Kubernetes PersistentVolumeClaim size for the PostgreSQL Write-ahead Log storage
Key walStorage.volumeSpec.accessmode
Value string
Example ReadWriteOnce
Description The Kubernetes PersistentVolumeClaim access modes for the PostgreSQL Write-ahead Log storage
Key walStorage.volumeSpec.storagetype
Value string
Example dynamic
Description Type of the PostgreSQL Write-ahead Log storage provisioning: create (the default variant; used if storage is provisioned, e.g. using hostpath) or dynamic (for a dynamic storage provisioner, e.g. via a StorageClass)
Key walStorage.volumeSpec.storageclass
Value string
Example ""
Description Optionally sets the Kubernetes storage class to use with the PostgreSQL Write-ahead Log storage PersistentVolumeClaim
Key walStorage.volumeSpec.matchLabels
Value string
Example ""
Description A PostgreSQL Write-ahead Log storage label selector

Backup Section

The backup section in the deploy/cr.yaml file contains the following configuration options for the regular Percona Distribution for PostgreSQL backups.

Key backup.image
Value string
Example perconalab/percona-postgresql-operator:main-ppg13-pgbackrest
Description The Docker image for pgBackRest
Key backup.backrestRepoImage
Value string
Example perconalab/percona-postgresql-operator:main-ppg13-pgbackrest-repo
Description The Docker image for the BackRest repository
Key backup.resources.requests.cpu
Value string
Example 500m
Description Kubernetes CPU requests for a pgBackRest container
Key backup.resources.requests.memory
Value int
Example 48Mi
Description The Kubernetes memory requests for a pgBackRest container
Key backup.resources.limits.cpu
Value int
Example 1
Description Kubernetes CPU limits for a pgBackRest container
Key backup.resources.limits.memory
Value int
Example 64Mi
Description The Kubernetes memory limits for a pgBackRest container
Key backup.affinity.antiAffinityType
Value string
Example preferred
Description Pod anti-affinity type, can be either preferred or required
Key backup.volumeSpec.size
Value int
Example 1G
Description The Kubernetes PersistentVolumeClaim size for the pgBackRest Storage
Key backup.volumeSpec.accessmode
Value string
Example ReadWriteOnce
Description The Kubernetes PersistentVolumeClaim access modes for the pgBackRest Storage
Key backup.volumeSpec.storagetype
Value string
Example dynamic
Description Type of the pgBackRest storage provisioning: create (the default variant; used if storage is provisioned, e.g. using hostpath) or dynamic (for a dynamic storage provisioner, e.g. via a StorageClass)
Key backup.volumeSpec.storageclass
Value string
Example ""
Description Optionally sets the Kubernetes storage class to use with the pgBackRest Storage PersistentVolumeClaim
Key backup.volumeSpec.matchLabels
Value string
Example ""
Description A pgBackRest storage label selector
Key backup.storages.<storage-name>.type
Value string
Example s3
Description Type of the storage used for backups
Key backup.storages.<storage-name>.endpointURL
Value string
Example minio-gateway-svc:9000
Description The endpoint URL of the S3-compatible storage to be used for backups (not needed for the original Amazon S3 cloud)
Key backup.storages.<storage-name>.bucket
Value string
Example ""
Description The Amazon S3 bucket or Google Cloud Storage bucket
name used for backups
Key backup.storages.<storage-name>.region
Value boolean
Example us-east-1
Description The AWS region to use for Amazon and all S3-compatible storages
Key backup.storages.<storage-name>.uriStyle
Value string
Example path
Description Optional parameter that specifies if pgBackRest should use the path or host S3 URI style
Key backup.storages.<storage-name>.verifyTLS
Value boolean
Example false
Description Enables or disables TLS verification for pgBackRest
Key backup.storageTypes
Value array
Example [ "s3" ]
Description The backup storage types for the pgBackRest repository
Key backup.repoPath
Value string
Example ""
Description Custom path for pgBackRest repository backups
Key backup.schedule.name
Value string
Example sat-night-backup
Description The backup name
Key backup.schedule.schedule
Value string
Example 0 0 \* \* 6
Description Scheduled time to make a backup specified in the
crontab format
Key backup.schedule.keep
Value int
Example 3
Description The amount of most recent backups to store. Older backups are automatically deleted. Set keep to zero or completely remove it to disable automatic deletion of backups
Key backup.schedule.type
Value string
Example full
Description The type of the pgBackRest backup
Key backup.schedule.storage
Value string
Example local
Description The type of the pgBackRest repository
Key backup.schedule.backrestOpts
Value string
Example --annotation=source=scheduled-backup
Description Custom pgBackRest configuration options for scheduled backups
Key backup.customconfig
Value string
Example ""
Description Name of the ConfigMap to pass custom pgBackRest configuration options
Key backup.imagePullPolicy
Value string
Example Always
Description This option is used to set the policy for updating pgBackRest images

PMM Section

The pmm section in the deploy/cr.yaml file contains configuration options for Percona Monitoring and Management.

Key pmm.enabled
Value boolean
Example false
Description Enables or disables monitoring Percona Distribution for PostgreSQL cluster with PMM
Key pmm.image
Value string
Example percona/pmm-client:2.41.2
Description Percona Monitoring and Management (PMM) Client Docker image
Key pmm.serverHost
Value string
Example monitoring-service
Description Address of the PMM Server to collect data from the cluster
Key pmm.serverUser
Value string
Example admin
Description The PMM Server User. The PMM Server password should be configured using Secrets
Key pmm.pmmSecret
Value string
Example cluster1-pmm-secret
Description Name of the Kubernetes Secret object for the PMM Server password
Key pmm.resources.requests.memory
Value string
Example 200M
Description The Kubernetes memory requests for a PMM container
Key pmm.resources.requests.cpu
Value string
Example 500m
Description Kubernetes CPU requests for a PMM container
Key pmm.resources.limits.cpu
Value string
Example 500m
Description Kubernetes CPU limits for a PMM container
Key pmm.resources.limits.memory
Value string
Example 200M
Description The Kubernetes memory limits for a PMM container
Key pmm.imagePullPolicy
Value string
Example Always
Description This option is used to set the policy for updating PMM Client images

pgBouncer Section

The pgBouncer section in the deploy/cr.yaml file contains configuration options for the pgBouncer connection pooler for PostgreSQL.

Key pgBouncer.image
Value string
Example perconalab/percona-postgresql-operator:main-ppg13-pgbouncer
Description Docker image for the pgBouncer connection pooler
Key pgBouncer.exposePostgresUser
Value boolean
Example false
Description Enables or disables exposing postgres user through pgBouncer
Key pgBouncer.size
Value int
Example 1G
Description The number of the pgBouncer Pods to provide connection pooling
Key pgBouncer.resources.requests.cpu
Value int
Example 1
Description Kubernetes CPU requests for a pgBouncer container
Key pgBouncer.resources.requests.memory
Value int
Example 128Mi
Description The Kubernetes memory requests for a pgBouncer container
Key pgBouncer.resources.limits.cpu
Value int
Example 2
Description Kubernetes CPU limits for a pgBouncer container
Key pgBouncer.resources.limits.memory
Value int
Example 512Mi
Description The Kubernetes memory limits for a pgBouncer container
Key pgBouncer.affinity.antiAffinityType
Value string
Example preferred
Description Pod anti-affinity type, can be either preferred or required
Key pgBouncer.expose.serviceType
Value string
Example ClusterIP
Description Specifies the type of Kubernetes Service for pgBouncer
Key pgBouncer.expose.loadBalancerIP
Value string
Example 127.0.0.1
Description The static IP-address for the load balancer
Key pgBouncer.expose.loadBalancerSourceRanges
Value string
Example "10.0.0.0/8"
Description The range of client IP addresses from which the load balancer should be reachable (if not set, there is no limitations)
Key pgBouncer.expose.annotations
Value label
Example pg-cluster-annot: cluster1
Description The Kubernetes annotations metadata for pgBouncer
Key pgBouncer.expose.labels
Value label
Example pg-cluster-label: cluster1
Description Set labels for the pgBouncer Service
Key pgBouncer.imagePullPolicy
Value string
Example Always
Description This option is used to set the policy for updating pgBouncer images

pgReplicas Section

The pgReplicas section in the deploy/cr.yaml file stores information required to manage the replicas within a PostgreSQL cluster.

Key pgReplicas..size
Value int
Example 1G
Description The number of the PostgreSQL Replica Pods
Key pgReplicas..resources.requests.cpu
Value int
Example 500m
Description Kubernetes CPU requests for a PostgreSQL Replica container
Key pgReplicas..resources.requests.memory
Value int
Example 256Mi
Description The Kubernetes memory requests for a PostgreSQL Replica container
Key pgReplicas..resources.limits.cpu
Value int
Example 500m
Description Kubernetes CPU limits for a PostgreSQL Replica container
Key pgReplicas..resources.limits.memory
Value int
Example 256Mi
Description The Kubernetes memory limits
for a PostgreSQL Replica container
Key pgReplicas..volumeSpec.accessmode
Value string
Example ReadWriteOnce
Description The Kubernetes PersistentVolumeClaim access modes for the PostgreSQL Replica storage
Key pgReplicas..volumeSpec.size
Value int
Example 1G
Description The Kubernetes PersistentVolumeClaim size for the PostgreSQL Replica storage
Key pgReplicas..volumeSpec.storagetype
Value string
Example dynamic
Description Type of the PostgreSQL Replica storage provisioning: create (the default variant; used if storage is provisioned, e.g. using hostpath) or dynamic (for a dynamic storage provisioner, e.g. via a StorageClass)
Key pgReplicas..volumeSpec.storageclass
Value string
Example standard
Description Optionally sets the Kubernetes storage class to use with the PostgreSQL Replica storage PersistentVolumeClaim
Key pgReplicas..volumeSpec.matchLabels
Value string
Example ""
Description A PostgreSQL Replica storage label selector
Key pgReplicas..labels
Value label
Example pg-cluster-label: cluster1
Description Set labels for PostgreSQL Replica Pods
Key pgReplicas..annotations
Value label
Example pg-cluster-annot: cluster1-1
Description The Kubernetes annotations metadata for PostgreSQL Replica
Key pgReplicas..expose.serviceType
Value string
Example ClusterIP
Description Specifies the type of Kubernetes Service for for PostgreSQL Replica
Key pgReplicas..expose.loadBalancerSourceRanges
Value string
Example "10.0.0.0/8"
Description The range of client IP addresses from which the load balancer should be reachable (if not set, there is no limitations)
Key pgReplicas..expose.annotations
Value label
Example pg-cluster-annot: cluster1
Description The Kubernetes annotations metadata for PostgreSQL Replica
Key pgReplicas..expose.labels
Value label
Example pg-cluster-label: cluster1
Description Set labels for the PostgreSQL Replica Service

pgBadger Section

The pgBadger section in the deploy/cr.yaml file contains configuration options for the pgBadger PostgreSQL log analyzer.

Key pgBadger.enabled
Value boolean
Example false
Description Enables or disables the pgBadger PostgreSQL log analyzer
Key pgBadger.image
Value string
Example perconalab/percona-postgresql-operator:main-ppg13-pgbadger
Description pgBadger PostgreSQL log analyzer Docker image
Key pgBadger.port
Value int
Example 10000
Description The port number for pgBadger
Key pgBadger.imagePullPolicy
Value string
Example Always
Description This option is used to set the policy for updating pgBadger images

Last update: 2024-10-29