postgres-pgdump-backup
by EugenMayer
Backup postgres databases using pg_dump, retention and schedules
About this chart
CHANGELOG 0.7.0 had breaking changes - see changelog!
WAT
Helm for the postgres 'pg_dump' based backup solution postgres-backup-local. It offers a backup solution with those key features
- schedules
- retentions
- health monitoring of the jobs
- using pg_dump / pg_dumpall as storage formats (not WAL)
- can backup specific databases or all databases (all databases is the default)
You find all the important documentation in the official repository documentation.
This chart does just try to provide an option to run the original image, not introducing any additional functionalities or anything else - we keep it vanilla. If you need anything else, ask in postgres-backup-local.
We do not re-publish the docker-image but use the original one published in postgres-backup-local.
Install
helm repo add eugenmayer https://eugenmayer.github.io/helm-charts/
helm install eugenmayer/postgres-pgdump-backup
Adjustments / Fixes
- To fix https://github.com/prodrigestivill/docker-postgres-backup-local/issues/76 we are current also exposing
PGUSER,PGPASSWORD,PGHOST,PGPORTas additional env variables
Helm values
Mandatory values to set
tag: You have to select a postgres dump version to deploy - use the same version as your serverPGHOST: hostname/ip of your pgPOSTGRES_DB: comma seperated list of databases to backup, for example:sko,mattermost,paperless
For example
image:
tag: "16-debian"
workload:
main:
podSpec:
containers:
main:
env:
POSTGRES_HOST: mypostgres.local
POSTGRES_DB: sko,mattermost,paperless
You will also need to deploy a secret called postgres-backup-local (you can rename it, see values.yaml) with the following values
POSTGRES_USERPOSTGRES_PASSWORDPGUSER(same values, optional)PGPASSWORD(same values, optional)
see values.yaml for a full list, but you will need to set
FAQ
- How to enable ssl support? Add this to your values.yaml
workload: main: podSpec: containers: main: env: PGSSLMODE: "require"
Developing
Test chart-rendering
helm template . -f values.yaml
Credits
Of course all the credits are going to postgres-backup-local doing all the important and hard work.
Also credits to duck-helm/postgres-backup-local, which was the base of this helm chart when it started.
Deploy postgres-pgdump-backup with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has postgres-pgdump-backup on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartpostgres-pgdump-backup is pinned at v0.8.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply