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

[Feature]: Give the possibility to automatically clean pgbench jobs - ttlSecondsAfterFinished option #4374

Open
2 tasks done
pchovelon opened this issue Apr 25, 2024 · 0 comments · May be fixed by #4384
Open
2 tasks done
Assignees
Labels
triage Pending triage

Comments

@pchovelon
Copy link
Contributor

pchovelon commented Apr 25, 2024

Is there an existing issue already for this feature request/idea?

  • I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.

What problem is this feature going to solve? Why should it be added?

pgbench jobs are not cleaned by default. It would be great to have to possibility to clean them automatically after a certain time.

Describe the solution you'd like

The ttlSecondsAfterFinished option of a Kubernetes Job could be implemented. See https://kubernetes.io/docs/concepts/workloads/controllers/job/#clean-up-finished-jobs-automatically

It could be configured in the YAML file, in a job or pgbench / section . For example for one hour TTL :

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
  name: perf-cluster
spec:
  imageName: ghcr.io/cloudnative-pg/postgresql:16.2
  instances: 1
  pgbench:
    ttlSecondsAfterFinished: '3600'
...

By default, we can keep it disabled.

Describe alternatives you've considered

It could be done as a parameter given at the pgbench plugin.
kubectl cnpg pgbench --ttl 300 .....

Additional context

No response

Backport?

No

Are you willing to actively contribute to this feature?

Yes

Code of Conduct

  • I agree to follow this project's Code of Conduct
@pchovelon pchovelon added the triage Pending triage label Apr 25, 2024
@pchovelon pchovelon linked a pull request Apr 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Pending triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants