Managed PostgreSQL Service

PostgreSQL is currently the leading choice among relational databases, known for its robust features and performance. The Managed PostgreSQL Service takes advantage of platform-side implementation to provide a self-healing replicated cluster. This cluster is efficiently managed using the highly acclaimed CloudNativePG operator, which has gained popularity within the community.

Deployment Details

This managed service is controlled by the CloudNativePG operator, ensuring efficient management and seamless operation.

HowTos

How to switch primary/secondary replica

See:

How to restore backup

find snapshot:

restic -r s3:s3.example.org/postgres-backups/database_name snapshots

restore:

restic -r s3:s3.example.org/postgres-backups/database_name restore latest --target /tmp/

more details:

Parameters

Common parameters

NameDescriptionValue
externalEnable external access from outside the clusterfalse
sizePersistent Volume size10Gi
replicasNumber of Postgres replicas2
storageClassStorageClass used to store the data""
postgresql.parameters.max_connectionsDetermines the maximum number of concurrent connections to the database server. The default is typically 100 connections100
quorum.minSyncReplicasMinimum number of synchronous replicas that must acknowledge a transaction before it is considered committed.0
quorum.maxSyncReplicasMaximum number of synchronous replicas that can acknowledge a transaction (must be lower than the number of instances).0

Configuration parameters

NameDescriptionValue
usersUsers configuration{}
databasesDatabases configuration{}

Backup parameters

NameDescriptionValue
backup.enabledEnable pereiodic backupsfalse
backup.scheduleCron schedule for automated backups0 2 * * * *
backup.retentionPolicyThe retention policy30d
backup.destinationPathThe path where to store the backup (i.e. s3://bucket/path/to/folder)s3://BUCKET_NAME/
backup.endpointURLEndpoint to be used to upload data to the cloudhttp://minio-gateway-service:9000
backup.s3AccessKeyThe access key for S3, used for authenticationoobaiRus9pah8PhohL1ThaeTa4UVa7gu
backup.s3SecretKeyThe secret key for S3, used for authenticationju3eum4dekeich9ahM1te8waeGai0oog

Bootstrap parameters

NameDescriptionValue
bootstrap.enabledRestore cluster from backupfalse
bootstrap.recoveryTimeTime stamp up to which recovery will proceed, expressed in RFC 3339 format, if empty, will restore latest""
bootstrap.oldNameName of cluster before deleting""
resourcesExplicit CPU and memory configuration for each PostgreSQL replica. When left empty, the preset defined in resourcesPreset is applied.{}
resourcesPresetDefault sizing preset used when resources is omitted. Allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge.micro

Parameter examples and reference

resources and resourcesPreset

resources sets explicit CPU and memory configurations for each replica. When left empty, the preset defined in resourcesPreset is applied.

resources:
  cpu: 4000m
  memory: 4Gi

resourcesPreset sets named CPU and memory configurations for each replica. This setting is ignored if the corresponding resources value is set.

Preset nameCPUmemory
nano100m128Mi
micro250m256Mi
small500m512Mi
medium500m1Gi
large12Gi
xlarge24Gi
2xlarge48Gi

users

users:
  user1:
    password: strongpassword
  user2:
    password: hackme
  airflow:
    password: qwerty123
  debezium:
    replication: true

databases

databases:          
  myapp:            
    roles:          
      admin:        
      - user1       
      - debezium    
      readonly:     
      - user2       
  airflow:          
    roles:          
      admin:        
      - airflow     
    extensions:     
    - hstore