Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sheduled kubernetes pg-backup objects are not automatically cleaned up #676

Open
konoox opened this issue Feb 26, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@konoox
Copy link

konoox commented Feb 26, 2024

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

  1. Create a pg cluster with a backup storage and schedule section defined and a retention period
  2. On the scheduled time, pg-backup resource is created with the related job, pod, pgbackrest backup and items in the storage
  3. 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

  1. Kubernetes - v1.27.6
  2. Operator - Percona for PostgreSQL 2.3.1
  3. Database - PostgreSQL 15.5

Anything else?

No response

@konoox konoox added the bug Something isn't working label Feb 26, 2024
@hors
Copy link
Collaborator

hors commented Feb 26, 2024

Hi @konoox, we have a task about it https://perconadev.atlassian.net/browse/K8SPG-502. We will fix this bug in the next release.

@mfilipe
Copy link

mfilipe commented Aug 12, 2024

I have this problem using 2.4.0. pg-backup are being deleted but jobsin Kubernetes are not being cleaned up.

Should I set spec.backups.pgbackrest.jobs.ttlSecondsAfterFinished?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants