Tekton Task: Difference between revisions
No edit summary |
No edit summary |
||
Line 37: | Line 37: | ||
- name: <font color=indigo><''some-name''></font> | - name: <font color=indigo><''some-name''></font> | ||
description: '...' | description: '...' | ||
[[# | [[#Step_Template|stepTemplate]]: | ||
env: | env: | ||
- name: '...' | - name: '...' | ||
Line 61: | Line 61: | ||
- name: <font color=indigo>''volume-name''</font> | - name: <font color=indigo>''volume-name''</font> | ||
emptyDir: {} | emptyDir: {} | ||
[[# | [[#Sidecar|sidecars]]: | ||
- image: <font color=indigo>''some-image''</font> | - image: <font color=indigo>''some-image''</font> | ||
name: <font color=indigo>''some-name''</font> | name: <font color=indigo>''some-name''</font> | ||
Line 103: | Line 103: | ||
<font color=darkkhaki>TO PROCESS.</font> | <font color=darkkhaki>TO PROCESS.</font> | ||
= | =Step Template= | ||
{{External|https://tekton.dev/docs/pipelines/tasks/#specifying-a-step-template}} | {{External|https://tekton.dev/docs/pipelines/tasks/#specifying-a-step-template}} | ||
Specifies a container step definition to use as the basis for all [[Tekton_Step#Overview|steps]] in this task. | Specifies a container step definition to use as the basis for all [[Tekton_Step#Overview|steps]] in this task. | ||
Line 109: | Line 109: | ||
<font color=darkkhaki>TO PROCESS.</font> | <font color=darkkhaki>TO PROCESS.</font> | ||
= | =Sidecar= | ||
{{External|https://tekton.dev/docs/pipelines/tasks/#specifying-sidecars}} | {{External|https://tekton.dev/docs/pipelines/tasks/#specifying-sidecars}} | ||
Specifies sidecar containers to run alongside the [[Tekton_Step#Overview|steps]] in the task. | Specifies sidecar containers to run alongside the [[Tekton_Step#Overview|steps]] in the task. | ||
Line 115: | Line 115: | ||
<font color=darkkhaki>TO PROCESS.</font> | <font color=darkkhaki>TO PROCESS.</font> | ||
=Task Operations= | |||
* [[Tekton_Operations#List_Tasks|List tasks]] | * [[Tekton_Operations#List_Tasks|List tasks]] |
Latest revision as of 23:33, 28 April 2022
External
- https://tekton.dev/docs/pipelines/tasks/
- https://github.com/tektoncd/pipeline/blob/main/docs/tasks.md
Internal
Overview
A task defines a series of ordered steps, which are executed in order in which they are declared. The output of a step can be used as the input of the next step. Each task executes in its own Kubernetes pod, where individual steps are executed as pod containers, so by default, tasks within a pipeline do not share data. To make tasks share data, they must be explicitly configured to make their outputs available to the next task, and to ingest the outputs of a previously executed task, as inputs. A task can be executed on its own, or part of a pipeline. The task is implemented as a Kubernetes custom resource.
Example
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: hello
spec:
steps:
- name: echo
image: alpine
script: |
#!/bin/sh
echo "Hello World"
Manifest
apiVersion: tekton.dev/v1beta1 # required field kind: Task # required field metadata: # required field name: <task-name> # required field spec: # required field description: 'this is an optional description' params: - name: <some-array-parameter> type: array - name: <some-string-parameter> type: string results: - name: <some-name> description: '...' stepTemplate: env: - name: '...' value: '...' steps: # required field - name: step-1 image: ubuntu args: ["ubuntu-build-example", "SECRETS-example.md"] - image: gcr.io/example-builders/build-example command: ["echo"] args: ["$(params.pathToDockerFile)"] - name: step-3 image: gcr.io/example-builders/push-example args: ["push", "$(resources.outputs.builtImage.url)"] volumeMounts: - name: docker-socket-example mountPath: /var/run/docker.sock workspaces: - name: workspace-name description: mountPath: path-relative-to-root volumes: - name: volume-name emptyDir: {} sidecars: - image: some-image name: some-name securityContext: privileged: true volumeMounts: - name: some-name mountPath: some-mount-path resources: # deprecated inputs: - name: ... type: ... outputs: - name: ... type: ...
Parameters
Resources
PipelineResources are deprecated. This field is valid for alpha only. TO PROCESS.
Workspace
Specifies paths to volumes required by the this task.
TO PROCESS.
Results
Specifies the names under which this task writes execution results. A task is able to emit string results that can be viewed by users and passed to other tasks in the pipeline. These results have a wide variety of potential uses
TO PROCESS.
Volume
Specifies one or more volumes that will be available to the steps in this task.
TO PROCESS.
Step Template
Specifies a container step definition to use as the basis for all steps in this task.
TO PROCESS.
Sidecar
Specifies sidecar containers to run alongside the steps in the task.
TO PROCESS.