Tekton Pipeline: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 61: Line 61:
The pipeline specification contains a mandatory list of <code>[[#_tasks|tasks]]</code>. The list specifies the tasks that comprise this pipeline and the details of their execution.
The pipeline specification contains a mandatory list of <code>[[#_tasks|tasks]]</code>. The list specifies the tasks that comprise this pipeline and the details of their execution.
=Parameters=
=Parameters=
{{Internal|Tekton Parameters#Pipeline_Parameters|Tekton Parameters}}
The pipeline parameters are listed under the <code>[[#_params|params]]</code> field. For more details about Tekton parameters, see: {{Internal|Tekton Parameters#Pipeline_Parameters|Tekton Parameters}}


=Workspaces=
=Workspaces=

Revision as of 21:18, 28 April 2022

External

Internal

Overview

A pipeline defines a series of ordered tasks. Just like steps, a task in a pipeline can use as input the output of a previously executed task. Tekton collects all the tasks, and based on the dependency relationships declared in definition of the pipeline, it orders the tasks in a DAG, and executes the graph in sequence. That results in the materialization of a number of task pods. The pipeline comes up with additional features, such as the capability to fan-out task execution, retry task execution or verify conditions that tasks must meet before proceeding. The pipeline is implemented as a Kubernetes custom resource.

Example

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: task1
spec:
  steps:
    - name: echo
      image: alpine
      script: |
        #!/bin/sh
        echo "this is Task 1 output"
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: task2
spec:
  steps:
    - name: echo
      image: alpine
      script: |
        #!/bin/sh
        echo "this is Task 2 output"
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: simple-pipeline
spec:
  tasks:
    - name: task1
      taskRef:
        name: task1
    - name: task2
      runAfter:
        - task1
      taskRef:
        name: task2

Manifest

apiVersion: tekton.dev/v1beta1 # required field
kind: Pipeline                 # required field
metadata:                      # required field
  name: <pipeline-name>        # required field
spec:                          # required field
  tasks:                       # required field

Tasks

The pipeline specification contains a mandatory list of tasks. The list specifies the tasks that comprise this pipeline and the details of their execution.

Parameters

The pipeline parameters are listed under the params field. For more details about Tekton parameters, see:

Tekton Parameters

Workspaces