build icon indicating copy to clipboard operation
build copied to clipboard

Pruning of BuildRun Objects

Open gabemontero opened this issue 5 years ago • 7 comments

openshift build v1 api today has fields that allow on a per build config basis the maximum amount of builds to keep in etcd.

Tekton has an unimplemented open features for this: https://github.com/tektoncd/pipeline/issues/1334 , https://github.com/tektoncd/pipeline/issues/1302 , and those also reference the upstream alpha feature around TTL for jobs/pods

build v2 tie in to the upstream tekton solution seems the long term solution

it that takes too long, do they want to build something akin to what exists in the build v1 controller for build v2?

gabemontero avatar Mar 04 '20 21:03 gabemontero

related code in build v1 https://github.com/openshift/openshift-controller-manager/blob/071b34b64ea82e87014bccb2ed14f6c2cf4ac9fe/pkg/build/controller/common/util.go#L40

sbose78 avatar May 22 '20 01:05 sbose78

@sbose78 so we want this? looks ideal to have from my side

qu1queee avatar May 25 '20 11:05 qu1queee

Upstream Tekton supports manual pruning of TaskRun/PipelineRun via the tkn cli. Perhaps we can take a similar approach with our cli.

adambkaplan avatar Oct 29 '20 15:10 adambkaplan

Another alternative is to control this per namespace. Kubernetes supports resource quotas( see https://kubernetes.io/docs/concepts/policy/resource-quotas/#object-count-quota ) for CRDs. However I dont think this approach is ideal for this issue. I think this needs to be worked on Tekton side, I will ask the Tekton community inside IBM for more information.

qu1queee avatar Nov 02 '20 18:11 qu1queee

Another alternative is to control this per namespace. Kubernetes supports resource quotas( see https://kubernetes.io/docs/concepts/policy/resource-quotas/#object-count-quota ) for CRDs. However I dont think this approach is ideal for this issue. I think this needs to be worked on Tekton side, I will ask the Tekton community inside IBM for more information.

I'll be curious what you hear on the Tekton/IBM side (and who precisely, as I may have interacted with some of the folks you talk to).

My high level interpretation over the last year of so:

  • they defer to manual / outside of the project efforts for this a la what @adambkaplan noted above
  • there was some hope a while back on working off of the upstream k8s efforts around Job pruning, but that has fizzled / now worked out (both upstream k8s and tekton)

gabemontero avatar Nov 02 '20 19:11 gabemontero

@gabemontero yes, from Tekton ( mainly communicating with https://github.com/afrittoli ) side what they have is external ways for deleting existing resources, e.g.:

  • nightly CIs ( e.g. cronjob )
  • tkn provides that feature to delete resources ( e.g. we could reuse their go pkg for deleting )

but nothing related to a mechanism for pruning resources based on some threshold that was reached ( e.g. we exceed 100 taskruns per namespace ) .

We should continue using this issue to provide more ideas on how to achieve this for us.

qu1queee avatar Nov 03 '20 12:11 qu1queee

Ship: https://github.com/shipwright-io/community/pull/61

SaschaSchwarze0 avatar Feb 14 '22 16:02 SaschaSchwarze0