Install Tasks
Tasks consist of a number of steps that are executed sequentially. Tasks are executed/run by creating TaskRuns.
A TaskRun will schedule a Pod. Each step is executed in a separate container within the same pod. They can also have inputs and outputs in order to interact with other tasks in the pipeline.
Here is an example of a Maven task for building a Maven-based Java application:
When a task starts running, it starts a pod and runs each step sequentially in a separate container on the same pod. Tasks can have one or multiple steps, and, since they run within the same pod, they have access to the same volumes in order to cache files, access configmaps, secrets, etc.
As mentioned previously, tasks can receive inputs (e.g. a git repository) and produce outputs (e.g. an image in a registry).
Note that only the requirement for a git repository is declared on the task and not a specific git repository to be used. That allows tasks to be reusable for multiple pipelines and purposes.
You can find more examples of reusable tasks in the Tekton Catalog and OpenShift Catalog repositories.
Install the apply-manifests
and update-deployment
tasks from the repository using oc
or kubectl
, which you will need for creating a pipeline in the next section:
Alternatively, in the OpenShift Web Console, you can click on the + at the top right of the screen while you are in the pipelines-tutorial project and import the YAML files from apply-manifests and update-deployment
You can take a look at the tasks you created using the Tekton CLI:
We will be using buildah
clusterTasks, which gets installed along with Operator. Operator installs few ClusterTask which you can see.
Last updated