-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Feature request
Allow Pipeline authors to specify computeResources and/or stepSpecs on PipelineTask (in a Pipeline definition), so that a Pipeline can override the resource requirements of a referenced Task without duplicating the Task or pushing the decision to PipelineRun users.
Today, resource overrides are only possible at:
- Task level:
Task.spec.steps[].computeResources(set by the task author) - PipelineRun level:
PipelineRun.spec.taskRunSpecs[].computeResources(set by the user at runtime)
There is no way for a Pipeline author to override resources at definition time. This forces pipeline authors to either duplicate tasks with different resource values or require users to specify taskRunSpecs in every PipelineRun.
A possible API shape:
apiVersion: tekton.dev/v1
kind: Pipeline
spec:
tasks:
- name: build
taskRef:
name: buildah
# New field — overrides the referenced Task's resource requirements
computeResources:
requests:
memory: 4Gi
cpu: "2"
limits:
memory: 8GiThe precedence would be: Task defaults < Pipeline overrides < PipelineRun overrides, consistent with how other overridable fields (e.g., timeout) already work.
The PipelineTaskRunSpec struct on PipelineRun already supports computeResources, stepSpecs, and sidecarSpecs. Mirroring some or all of these fields onto PipelineTask would close the gap.
Use case
In Konflux, tasks are defined with default resource limits and referenced by Pipelines that are distributed as bundles to users. The team needs multiple variants of the same pipeline (slim, normal, large) with different resource allocations for the same tasks.
Without Pipeline-level resource overrides, they must duplicate each task with only the resource values (and name) changed, and distribute each variant in a separate bundle. This leads to significant maintenance burden as the number of tasks and variants grows.
Being able to override task resources from the Pipeline definition would eliminate task duplication entirely — the team would distribute kustomized versions of the Pipeline only.
Related:
- TEP-0104 — Task-level resource requirements (implemented, but only for Task and TaskRun levels)
- FR: Task-level (and maybe Pipeline-level) resource requests and limits #4470 — Original FR that led to TEP-0104. Pipeline-level overrides were intentionally deferred due to concerns about aggregate Pipeline resource semantics, but per-PipelineTask overrides (as proposed here) do not have that ambiguity.
- Promote to GA: TEP-0104 Task level resource requirements #7400 — TEP-0104 GA promotion tracking