2021-05-17

Backup your PostgreSQL database on Kubernetes

I did not find any out of the box solution so I created my own.  Please see the Github Readme page for more information:

postgresql-backup-s3

It simply runs pg_dumpall and aws s3 cp but provides a simple solution that can be easily applied to production as well as development/test setups. 

If you want to have retention policies I recommend creating multiple jobs that upload to different folders:

  • daily -> s3://my-s3-bucket/daily
  • montly -> s3://my-s3-bucket/monthly
And then create a lifecycle rule for each with the corresponding prefix. These can then delete the backups after e.g. 30 days and 24 months correspondingly.


No comments:

Post a Comment

Backup your PostgreSQL database on Kubernetes

I did not find any out of the box solution so I created my own.  Please see the Github Readme page for more information: postgresql-backup-s...