Skip to content

Commit

Permalink
added doc and updated values
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunsinghot committed Jul 23, 2024
1 parent df898b7 commit f885882
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 9 deletions.
30 changes: 21 additions & 9 deletions charts/pg-operator-db/DOC.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
Backup -
Restore
Extension Installation
PGbouncer
Patroni Template -
LLVM (for JIT Compilation)
DR
Switch Over
User and DB creation
Monitoring

Restore -

Extension Installation- To use an extension, install it. Run the CREATE EXTENSION command on the PostgreSQL node where you want the extension to be available e.g. CREATE EXTENSION hstore SCHEMA demo; https://docs.percona.com/postgresql/13/extensions.html

PGbouncer- We are exposing the cluster through PgBouncer, which is enabled by default. It acts as DB proxy. It can be disabled by setting proxy.pgBouncer.replicas to 0. https://docs.percona.com/percona-operator-for-postgresql/2.0/expose.html

Patroni Template - It is a template for configuring a highly available PostgreSQL cluster. https://docs.percona.com/postgresql/16/solutions/high-availability.html

LLVM (for JIT Compilation)- Percona Operator is based on CrunchyData’s PostgreSQL Operator which includes LLVM (for JIT compilation). JIT compilation is the process of turning some form of interpreted program evaluation into a native program, and doing so at run time. For example, instead of using general-purpose code that can evaluate arbitrary SQL expressions to evaluate a particular SQL predicate like WHERE a.col = 3, it is possible to generate a function that is specific to that expression and can be natively executed by the CPU, yielding a speedup. https://www.postgresql.org/docs/current/jit-reason.html

DR - To achieve a production grade PostgreSQL disaster recovery solution, we need something that can take full or incremental database backups from a running instance, and restore from those backups at any point in time. Percona Distribution for PostgreSQL is supplied with pgBackRest: a reliable, open-source backup and recovery solution for PostgreSQL.

pgBackRest supports remote repository hosting and can even use cloud-based services like AWS S3, Google Cloud Services Cloud Storage, Azure Blob Storage for saving backup files.
https://docs.percona.com/postgresql/14/solutions/backup-recovery.html

Switch Over- In Percona Operator, the primary instance election can be controlled by the patroni.switchover section of the Custom Resource manifest. It allows to enable switchover targeting a specific PostgreSQL instance as the new primary, or just running a failover if PostgreSQL cluster has entered a bad state. https://docs.percona.com/percona-operator-for-postgresql/2.0/change-primary.html

User and DB creation- We can create the users and DB by providing values in the 'users' section in values.yaml. https://docs.percona.com/percona-operator-for-postgresql/2.0/users.html

Monitoring-
38 changes: 38 additions & 0 deletions charts/pg-operator-db/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,48 @@ pg-operator:
enabled: true
pg-db:
enabled: true
users:
- name: rhino
databases:
- zoo
options: "NOSUPERUSER"
password:
type: ASCII
secretName: "rhino-credentials"
instances:
- name: instance1
replicas: 2
dataVolumeClaimSpec:
# storageClassName: default
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
pmm:
enabled: false
proxy:
pgBouncer:
replicas: 2
config:
global:
client_tls_sslmode: prefer
patroni:
# Some values of the Liveness/Readiness probes of the patroni container are calulated using syncPeriodSeconds by the following formulas:
# - timeoutSeconds: syncPeriodSeconds / 2;
# - periodSeconds: syncPeriodSeconds;
# - failureThreshold: leaderLeaseDurationSeconds / syncPeriodSeconds.
syncPeriodSeconds: 10
leaderLeaseDurationSeconds: 30
dynamicConfiguration:
postgresql:
parameters:
max_parallel_workers: 2
max_worker_processes: 2
shared_buffers: 1GB
work_mem: 2MB
pg_hba:
- host all mytest 123.123.123.123/32 reject
switchover:
enabled: "true"
targetInstance: ""

0 comments on commit f885882

Please sign in to comment.