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

Completed Jobs Not Being Cleaned Up #420

Open
CH-BrianJurgess opened this issue Nov 14, 2024 · 1 comment
Open

Completed Jobs Not Being Cleaned Up #420

CH-BrianJurgess opened this issue Nov 14, 2024 · 1 comment

Comments

@CH-BrianJurgess
Copy link

We noticed that completed jobs are not being cleaned up. We currently have the job-ttl argument set to 5m in our configuration. I believe the configuration sets the .spec.ttlSecondsAfterFinished value on the job. It looks like this was introduced in Kubernetes 1.23. Unfortunately, we are not able to update K8S as rapidly. As a result, pods continue to pile up in our cluster requiring us to either create a cron to clean them up or to manually delete them.

An approach I've seen from Github Actions Kubernetes Runners is to have the controller watch for completed Jobs and clean them up manually.

I've attached an image from one of namespaces running the agents showing the pods continuing to exist past 5 minutes.

image

@DrJosh9000
Copy link
Contributor

Thanks for raising this @CH-BrianJurgess!

I think we will need to build a job cleanup function - aside from older k8s versions, there are other ways jobs can accumulate (e.g. they create successfully but can fail to start a pod for some reason, and sit around retrying forever).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants