A TaskRun is a Tekton resource representing one execution of a Task. A Task defines the container and commands; a TaskRun supplies execution-time values and selects the Task through taskRef. section 3.5.1
Applying a Task definition only makes it available to Tekton; it does not run it. Applying a TaskRun starts the execution in the cluster, and the task can be executed repeatedly by creating additional TaskRuns. section 3.5.1
Listing 3.2 A task run represents an instance of our task definition
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
name: hello-world-task-run-1
spec:
params:
- name: name
value: "Building Platforms on top of Kubernetes reader!" #1
taskRef:
name: hello-world-task #2
A minimal TaskRun names a task with taskRef and passes the name parameter used by the Task. section 3.5.1
Use Kubernetes and Tekton resources to inspect an execution:
- Apply the manifest with kubectl apply -f taskrun.yaml to start the run. section 3.5.1
- Run kubectl get taskrun to inspect status, start time, and completion time. section 3.5.1
- Inspect the associated pod and follow its logs to see the task output. section 3.5.1
Each TaskRun creates a pod for the task. When a PipelineRun executes a pipeline, Tekton creates one TaskRun and one pod per pipeline task, making TaskRuns the concrete executions orchestrated by a pipeline. section 3.5.2 section 3.5.1
Inspecting a completed run
A successful kubectl get taskrun result reports SUCCEEDED as True. The corresponding pod reaches Completed, and kubectl logs can show output such as “Hello World: Building Platforms on top of Kubernetes reader!”. section 3.5.1
