Skip to content

feat: allow Pipeline authors to override Task compute resources#9633

Draft
waveywaves wants to merge 1 commit intotektoncd:mainfrom
waveywaves:feature/pipeline-task-compute-resources
Draft

feat: allow Pipeline authors to override Task compute resources#9633
waveywaves wants to merge 1 commit intotektoncd:mainfrom
waveywaves:feature/pipeline-task-compute-resources

Conversation

@waveywaves
Copy link
Member

Changes

Adds stepSpecs, sidecarSpecs, and computeResources fields to PipelineTask,
allowing Pipeline authors to override the referenced Task's resource requirements
without duplicating the Task or requiring users to specify taskRunSpecs in every
PipelineRun.

The problem

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 — both of which are poor UX as demonstrated by
recent Konflux issues where users had to override resources for dozens of individual .tekton
files.

The solution

apiVersion: tekton.dev/v1
kind: Pipeline
spec:
  tasks:
    - name: build
      taskRef:
        name: buildah
      # NEW — override the referenced Task's resource requirements
      computeResources:
        requests:
          memory: 4Gi
      stepSpecs:
        - name: build
          computeResources:
            requests:
              memory: 8Gi
            limits:
              memory: 16Gi

Precedence chain: Task defaults < Pipeline PipelineTask overrides < PipelineRun taskRunSpecs overrides

This mirrors how timeout already works on PipelineTask — Pipeline sets a default, PipelineRun
can override it.

Implementation

  • API: Added StepSpecs, SidecarSpecs, ComputeResources fields to PipelineTask in
    pkg/apis/pipeline/v1/pipeline_types.go
  • Reconciler: In createTaskRun(), Pipeline-level values are set first, then PipelineRun-level
    taskRunSpecs override them if specified (pkg/reconciler/pipelinerun/pipelinerun.go)

TODO (follow-up commits)

  • Generated code (hack/update-codegen.sh)
  • Validation in pipeline_validation.go
  • Variable substitution support
  • Unit tests for precedence chain
  • E2E test
  • Documentation updates

Related Issues

Submitter Checklist

Release Note

Pipeline authors can now override Task compute resources (stepSpecs, sidecarSpecs,
computeResources) at the PipelineTask level, eliminating the need to duplicate Tasks
or require users to specify taskRunSpecs in every PipelineRun.

@tekton-robot tekton-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Mar 19, 2026
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from waveywaves after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot requested review from abayer and khrm March 19, 2026 16:26
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 19, 2026
@waveywaves waveywaves added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 19, 2026
@tekton-robot tekton-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 19, 2026
Add StepSpecs, SidecarSpecs, and ComputeResources fields to
PipelineTask, allowing Pipeline authors to override the referenced
Task's resource requirements without duplicating the Task or
requiring users to specify taskRunSpecs in every PipelineRun.

Precedence chain: Task defaults < Pipeline PipelineTask overrides <
PipelineRun taskRunSpecs overrides.

Changes:
- v1 PipelineTask: add StepSpecs, SidecarSpecs, ComputeResources
- v1beta1 PipelineTask: add matching fields + wire conversion
- Validation: reuse validateStepSpecs/validateSidecarSpecs/
  validateTaskRunComputeResources from taskrun_validation.go
- Variable substitution: apply param replacements to StepSpecs and
  SidecarSpecs names in replaceVariablesInPipelineTasks
- Reconciler: Pipeline-level values set first, PipelineRun-level
  taskRunSpecs override them if specified
- Regenerated deepcopy, CRD, OpenAPI, and API docs

Closes tektoncd#9630

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@waveywaves waveywaves force-pushed the feature/pipeline-task-compute-resources branch from 53f6316 to d6eca52 Compare March 19, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants