Skip to main content
A TaskRun represents a single execution of a Task. TaskRuns are how the steps specified in a Task are executed.

Resource Definition

apiVersion
string
required
tekton.dev/v1
kind
string
required
TaskRun
metadata
ObjectMeta
required
Standard Kubernetes metadata.
spec
TaskRunSpec
required
Defines the desired state of the TaskRun.
status
TaskRunStatus
Defines the observed state of the TaskRun.

TaskRunSpec

taskRef
TaskRef
Reference to the Task to execute. Mutually exclusive with taskSpec.
taskSpec
TaskSpec
Inline Task specification. Mutually exclusive with taskRef.Can be disabled by setting the disable-inline-spec feature flag.
params
[]Param
Parameters to pass to the Task.See Parameter Types for details.
serviceAccountName
string
ServiceAccount to use for running the TaskRun.
workspaces
[]WorkspaceBinding
Workspace bindings for the TaskRun.See Workspace Types for details.
timeout
Duration
Time after which the TaskRun times out. Defaults to 1 hour.Format: Go duration string (e.g., “1h30m”, “90m”)
retries
integer
default:0
Number of times to retry on task failure.
status
string
Used for cancelling a TaskRun.Values:
  • TaskRunCancelled - Cancel the TaskRun
statusMessage
string
Human-readable status message for cancellation.
computeResources
ResourceRequirements
Compute resources to use for this TaskRun.
podTemplate
PodTemplate
Pod-specific configuration for the TaskRun’s pod.

TaskRunStatus

conditions
[]Condition
Conditions describe the current state of the TaskRun.
startTime
Time
Time when the TaskRun started executing.
completionTime
Time
Time when the TaskRun completed.
podName
string
Name of the pod executing the TaskRun.
steps
[]StepState
State of each Step in the Task.
results
[]TaskRunResult
Results produced by the TaskRun.See Result Types for details.
taskSpec
TaskSpec
The resolved Task specification that was executed.

Example

apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  name: example-taskrun
spec:
  taskRef:
    name: example-task
  params:
    - name: message
      value: "Hello from TaskRun"
  timeout: 10m

Build docs developers (and LLMs) love