Skip to content

feat: allow Pipeline authors to override Task compute resources at the PipelineTask level #9630

@waveywaves

Description

@waveywaves

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: 8Gi

The 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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions