Tekton TaskRun: Difference between revisions
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=External= | =External= | ||
* https://tekton.dev/docs/pipelines/taskruns/ | |||
* https://github.com/tektoncd/pipeline/blob/main/docs/taskruns.md | * https://github.com/tektoncd/pipeline/blob/main/docs/taskruns.md | ||
Line 38: | Line 39: | ||
taskRef: | taskRef: | ||
name: | name: | ||
<span id='bundle'></span>[[ | <span id='bundle'></span>[[Tekton_Bundle|bundle]]: | ||
[[#Pod_Template|podTemplate]]: | [[#Pod_Template|podTemplate]]: | ||
schedulerName: <font color=indigo><''scheduler-name''></font> | schedulerName: <font color=indigo><''scheduler-name''></font> | ||
Line 71: | Line 72: | ||
{{External|https://tekton.dev/docs/pipelines/taskruns/#specifying-a-pod-template}} | {{External|https://tekton.dev/docs/pipelines/taskruns/#specifying-a-pod-template}} | ||
The pod template, if specifies, serves are the configuration starting point for the pod in which the container images specified by the task will execute. This permits customization of the pod configuration, to make it specific to this task run. | The pod template, if specifies, serves are the configuration starting point for the pod in which the container images specified by the task will execute. This permits customization of the pod configuration, to make it specific to this task run. | ||
<font color=darkkhaki>TO PROCESS.</font> | <font color=darkkhaki>TO PROCESS: | ||
* https://tekton.dev/docs/pipelines/podtemplates/ | |||
* https://tekton.dev/docs/pipelines/taskruns/#specifying-a-pod-template | |||
</font> | |||
=Workspace= | =Workspace= | ||
{{External|https://tekton.dev/docs/pipelines/taskruns/#specifying-workspaces}} | {{External|https://tekton.dev/docs/pipelines/taskruns/#specifying-workspaces}} |
Latest revision as of 04:22, 29 April 2022
External
- https://tekton.dev/docs/pipelines/taskruns/
- https://github.com/tektoncd/pipeline/blob/main/docs/taskruns.md
Internal
Overview
A task run (or taskRun) instantiates a specific task to execute on a particular set of inputs and produce a particular set of outputs, within specific conditions (for example, build flags). A task run connects resources with tasks. A task run can be created individually via CLI, by a pipeline run, as part of a pipeline, or by a Tekton components such as Tekton Triggers. The task run is implemented as a Kubernetes custom resource.
The task run can be used to parameterize the task. Specific values for task parameters can be declared in the task run.
Example
A simple taskrun example:
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: hello-task-run
spec:
taskRef:
name: hello
Manifest
apiVersion: tekton.dev/v1beta1 # required field kind: TaskRun # required field metadata: # required field name: <taskrun-name> # required field spec: # required field params: - name: <parameter-name> value: <some-value> serviceAccountName: <service-account-name> taskRef: # one of 'taskRef' and 'taskSpec' is required name: <target-task-name> taskSpec: # one of 'taskRef' and 'taskSpec' is required taskRef: name: bundle: podTemplate: schedulerName: <scheduler-name> securityContext: runAsNonRoot: true runAsUser: 1001 volumes: - name: <volume-name> persistentVolumeClaim: claimName: <claim-name> workspaces: - name: <workspace-name> # must match workspace name in the Task persistentVolumeClaim: claimName: <claim-name> # the PVC must already exist subPath: my-subdir sidecars: - ...
Specifying the Target Task
The target task can be specified either by reference, as shown above, or embedding the task specification under taskSpec
.
Remote Task
TO PROCESS: https://tekton.dev/docs/pipelines/taskruns/#remote-tasks
Parameters
Resources
PipelineResources are deprecated. This field is valid for alpha only. TO PROCESS.
Pod Template
The pod template, if specifies, serves are the configuration starting point for the pod in which the container images specified by the task will execute. This permits customization of the pod configuration, to make it specific to this task run. TO PROCESS:
- https://tekton.dev/docs/pipelines/podtemplates/
- https://tekton.dev/docs/pipelines/taskruns/#specifying-a-pod-template
Workspace
TO PROCESS.
Sidecar
TO PROCESS.
Timeout
TO PROCESS.
Service Account
TO PROCESS:
- https://tekton.dev/docs/pipelines/taskruns/#specifying-serviceaccount-credentials
- https://tekton.dev/docs/pipelines/taskruns/#example-of-using-custom-serviceaccount-credentials
TaskRun Life Cycle
TO PROCESS: https://tekton.dev/docs/pipelines/taskruns/#monitoring-execution-status