percona / percona/percona-postgresql-operator
Scheduled kubernetes pg-backup objects are not automatically cleaned up
@gkech is already working on this.
Since Sep 26, 2025.
- Dominant language
- Go
- Stars
- 385
- Forks
- 83
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 39
Description
Report
Sheduled kubernetes pg-backup objects are not automatically cleaned up
More about the problem
Since the 2.3.0 k8s Percona Postgres operator upgrade, pg-backup resources are created for each scheduled backup (K8SPG-410)
The pgbackrest backups and related items saved in the storage are still clean-up up properly following the retention rules defined in the spec.backups.pgbackrest.global.-retention-full* attributes of the pg cluster definition.
BUT the pg-backup related k8s resources are well created but never cleaned up even with the retention attributes properly defined.
This problem lead to a quick accumulation of pg-backups and jobs k8s resources in the namespaces using a pg cluster with scheduled backups.
Steps to reproduce
- Create a pg cluster with a backup storage and schedule section defined and a retention period
- On the scheduled time, pg-backup resource is created with the related job, pod, pgbackrest backup and items in the storage
- At the end of the retention period, pgbackrest backup and items are removed from the storage but none of the k8s resources (pg-backup and job) are not deleted
Versions
- Kubernetes - v1.27.6
- Operator - Percona for PostgreSQL 2.3.1
- Database - PostgreSQL 15.5
Anything else?
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.