Proposal: Adoption of event based pruner to tektoncd org
Feature request
This is a proposal to adopt event-based-pruner to tektoncd org.
This solution introduces a new event-driven pruning controller for Tekton that automatically cleans up completed PipelineRun and TaskRun resources based on configurations defined in a ConfigMap.
The core motivation behind the request is current pruning mechanisms in Tekton are distributed across multiple components, each with its own limitations. Here's a summary of the existing options:
- Operator-based pruner: A CronJob-based solution that runs in the tekton-pipelines namespace. It periodically launches a pod that uses the tkn CLI to delete PipelineRun and TaskRun resources across all namespaces. If users want namespace-specific pruning policies, they must add annotations to the namespace, which results in additional CronJobs being created per namespace.
- Tekton Results: Performs cleanup after exporting data by using finalizers, but it does not support time-based TTL or history limit based granular retention policies.
These approaches are fragmented, difficult to customize, and do not offer fine-grained control. Introducing a unified pruning controller brings all pruning logic into a single, consistent component—making it easier for users and administrators to manage resource cleanup.
Who Will Own it
- @anithapriyanatarajan
- @pramodbindal
- @vdemeester
- @savitaashture
- @jkhelil
- @jkandasa
- @waveywaves
- the existing maintainers [any other takers]
Who and/or approximately how many people currently use the project
The project is currently in an alpha state, and is being prepared for a Tech Preview release, targeted to be deployable with the upcoming major release of the Tekton Operator. This initial release will include minimal default configurations, focusing on ease of deployment and early feedback collection.
The project's existing stability policies, if any, and a proposed stability level after adoption
The project is in alpha stage. There are no API or Custom resources involved in the solution. The entire logic is based on controllers and configMap. In the initial alpha version v0.1.0 includes the cluster wide pruning config and Namespace specific overrides only.
A full fledged implemenattion of all requirements captured in TEP is targeted for next iteration.
Thanks @anithapriyanatarajan, this proposal looks good for me. Pruning is a feature many users have been requesting over the years, and not everyone uses operator or results, so it would be good to have an add-on service like this for Tekton users.
The only question I have left is about infrastructure: the Tekton project cannot afford to spend more on infra, in fact we need to continue reducing our spending, so the only condition I would have is for the project to ran its CI/CD with no extra cost to the project.
👍 I've had to hack up my own auto-cleaning mechanism in the past. This would be a valuable addition.
@wlynch @dibyom WDYT - it would be great to have your opinion so we may proceed with this if you agree.
Sounds good to me. I can see this being very useful. One thing I'd say though is with this we'll not have 3 ways to prune old runs, so let's make sure we have a plan to standardize
Hi @anithapriyanatarajan! Good thing and really useful 😸 👍 . I agree with @dibyom, there should be one standard way. Maybe the new way to go should be part of the TEP. The operator could also switch to the pruner in time.
There is a typo in the link to the TEP: 161 => 162.
Hi @anithapriyanatarajan! Good thing and really useful 😸 👍 . I agree with @dibyom, there should be one standard way. Maybe the new way to go should be part of the TEP. The operator could also switch to the pruner in time.
There is a typo in the link to the TEP: 161 => 162.
@twoGiants Thankyou. The link is fixed now.
I think we have a majority on the governance board agreed on this, so I think we can consider it being approved.
https://github.com/tektoncd/community/pull/1208 has been merged. We'll start working on migrating the project, and we will close this issue once the project is migrated.
https://github.com/tektoncd/pruner is created now. I'll update the teams & co later on 👼🏼