-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Introduce runHistoryLimit #2332
Comments
One way to configure this would be in a configmap in the Tekton installation, that would configure it installation/cluster-wide. Another option would be to add it as an option of the Trigger, and the triggerer would be responsible for deleting (and have permission🤔). This also only solves it for the triggering case, and ignores manual runs, or runs not triggered by "Triggers". |
Also related: #454 |
/kind feature |
We explored this idea a bit in #1486 and its related issue #1302. In that PR the idea was to use a TTL Controller to clean up resources. It was then suggested that we could use a |
I agree that a |
Expected Behavior
Assume I have a namespace with a Pipeline and a Trigger with a connected git-repo. Each commit to my git-repo would typically send a webhook to the Trigger and a new
PipelineRun
is created, e.g. for CI-builds.After some time, I will have a lot of
PipelineRun
resources in my namespace.I expect that Tekton, to some extent can garbage collect older resources, for sustainable use without manual intervention. I expect to be able to configure a history limit, per team-namespace or Pipeline - some apps/teams may want a longer history and some want to keep it shorter e.g. for resource cost when using e.g.
volumeClaimTemplate
that allocates a PersistentVolume as long as thePipelineRun
exists.Actual Behavior
Resources created by the Trigger or other tools need to be deleted manually.
Additional Info
Kubernetes
Deployment
andStatefulSet
has a fieldrevisionHistoryLimit
that reminds of this feature.Deployment
has a different resource structure, it createsReplicaSets
and "supervise" them, and also delete them. See https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/deployment/sync.go#L432-L438Proposed Design
How can this be added to Tekton? It is the
PipelineRun
andTaskRun
that is created from aTriggerTemplate
that need to have a history limit, e.g.runHistoryLimit
What controller should be responsible for the limit? Should any part of the Trigger be responsible, or should the pipelinerun-reconciler and taskrun-reconciler be responsible?
Some of this has been discussed in tektoncd/triggers#64 but
OwnerReference
is probably not the full solution here.The text was updated successfully, but these errors were encountered: