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

Cleanup completed pipeline and tasks runs through dashboard #1752

Closed
jtestard opened this issue Oct 8, 2020 · 9 comments · Fixed by #1811
Closed

Cleanup completed pipeline and tasks runs through dashboard #1752

jtestard opened this issue Oct 8, 2020 · 9 comments · Fixed by #1811
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@jtestard
Copy link

jtestard commented Oct 8, 2020

Is your feature request related to a problem ?

My dashboard is growing very large (lots of completed tasks) and I have no way to clean it up.

Describe the solution you'd like

I'd like a way to delete all completed tasks runs and pipeline runs.

Describe alternatives you've considered

I know there must be a formula to do this through kubectl but I haven't spent the time to construct it. If the workaround through CLI could be added in the comment, it would help a lot, thanks :).

@jtestard jtestard added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 8, 2020
@eddycharly
Copy link
Member

Hi @jtestard !
It’s not really a dashboard specific issue. I think we have an example of cleaning up script in the plumbing repo. Let me check...

@jtestard
Copy link
Author

jtestard commented Oct 8, 2020 via email

@eddycharly
Copy link
Member

Couldn’t find it, maybe @afrittoli knows the answer better ;)
At some point it will be an issue for every component. No cleanup means longer reconciliation time at startup etc... but I agree that it manifests quickly with the dashboard.

@jtestard
Copy link
Author

jtestard commented Oct 8, 2020

In general, at my company we are using tekton as early adopters because we are excited by the technology, but we are facing a number of problems that make tekton not quite "production-ready" yet for us. Happy to chat more about this. This issue is one of them.

@AlanGreene
Copy link
Member

AlanGreene commented Oct 8, 2020

Similar requests have come up before. The tkn CLI provides some help for this. For example:

tkn pr delete -p <pipeline-name> --keep 2

would delete all PipelineRuns of the specified Pipeline, keeping only the 2 most recent ones.

This is the approach used in our plumbing repo and is triggered by a Kubernetes CronJob, see https://github.com/tektoncd/plumbing/blob/698db03c9f9888c46a7219d9a40c6b2f24763d51/tekton/resources/cd/cleanup-template.yaml#L60

There's also an issue to add support for field selectors which might allow to query based on status or similar, however this is currently blocked by lack of support in Kubernetes, see tektoncd/cli#995 (comment) for more.

One option we've considered for the dashboard is the ability to select multiple runs in the dashboard UI and batch delete them, similar to what we currently support for Secrets and PipelineResources.

@eddycharly
Copy link
Member

IMO, tekton is un opinionated and you should not expect tekton to do things other than what it is supposed to do.

Some will use the dashboard while others won’t, some will want to keep everything around while some need some sort of garbage collection. Tekton won’t do anything on your back, maybe it should be more clear so that users don’t get surprised.

We often see similar requests though and it would be nice to have a place to provide guidance and tips because answering similar requests on a case by case basis is not effective.

@jtestard
Copy link
Author

jtestard commented Oct 8, 2020

One option we've considered for the dashboard is the ability to select multiple runs in the dashboard UI and batch delete them, similar to what we currently support for Secrets and PipelineResources.

This is interesting to us.

IMO, tekton is un opinionated and you should not expect tekton to do things other than what it is supposed to do.

Getting out of scope for this issue, but as long as there's an ecosystem in which add-ons can thrive, we could build our own for this kind of purpose as well.

@AlanGreene
Copy link
Member

Assigning to @steveodonovan to implement the batch delete piece of this.

@AlanGreene
Copy link
Member

There's now an example in the experimental repo with documentation showing how to use a CronJob to clean up completed runs. This is based on the approach from plumbing that I described above.

https://github.com/tektoncd/experimental/tree/721e8c4ec2848a609e436b2c392712b64d1cc792/pipeline/cleanup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants