Getting Started with Pipelines

Create and run your first Tekton Pipeline

This tutorial shows you how to:

  • Create two Tasks.
  • Create a Pipeline containing your Tasks.
  • Use PipelineRun to instantiate and run the Pipeline containing your Tasks.

This guide uses a local cluster with minikube.


  1. Complete the Getting started with Tasks tutorial. Do not clean up your resources, skip the last section.

  2. Install tkn, the Tekton CLI.

Create and run a second Task

You already have a “Hello World!” Task. To create a second “Goodbye!” Task:

  1. Create a new file named goodbye-world.yaml and add the following content:

    kind: Task
      name: goodbye
      - name: username
        type: string
        - name: goodbye
          image: ubuntu
          script: |
            echo "Goodbye $(params.username)!"        

    This Task takes one parameter, username. Whenever this Task is used a value for that parameter must be passed to the Task.

  2. Apply the Task file:

    kubectl apply --filename goodbye-world.yaml

When a Task is part of a Pipeline, Tekton creates a TaskRun object for every task in the Pipeline.

Create and run a Pipeline

A Pipeline defines an ordered series of Tasks arranged in a specific execution order as part of the CI/CD workflow.

In this section you are going to create your first Pipeline, that will include both the “Hello World!” and “Goodbye!” Tasks.

  1. Create a new file named hello-goodbye-pipeline.yaml and add the following content:

    kind: Pipeline
      name: hello-goodbye
      - name: username
        type: string
        - name: hello
            name: hello
        - name: goodbye
            - hello
            name: goodbye
          - name: username
            value: $(params.username)

    The Pipeline defines the parameter username, which is then passed to the goodbye Task.

  2. Apply the Pipeline configuration to your cluster:

    kubectl apply --filename hello-goodbye-pipeline.yaml
  3. A PipelineRun, represented in the API as an object of kind PipelineRun, sets the value for the parameters and executes a Pipeline. To create PipelineRun, create a new file named hello-goodbye-pipeline-run.yaml with the following:

    kind: PipelineRun
      name: hello-goodbye-run
        name: hello-goodbye
      - name: username
        value: "Tekton"

    This sets the actual value for the username parameter: "Tekton".

  4. Start the Pipeline by applying the PipelineRun configuration to your cluster:

    kubectl apply --filename hello-goodbye-pipeline-run.yaml

    You see the following output: created

    Tekton now starts running the Pipeline.

  5. To see the logs of the PipelineRun, use the following command:

    tkn pipelinerun logs hello-goodbye-run -f -n default

    The output shows both Tasks completed successfully:

    [hello : echo] Hello World!
    [goodbye : goodbye] Goodbye Tekton!


To learn about Tekton Triggers, skip this section and proceed to the next tutorial.

To delete the cluster that you created for this guide run:

minikube delete

The output confirms that the cluster was deleted:

🔥  Deleting "minikube" in docker ...
🔥  Deleting container "minikube" ...
🔥  Removing /home/user/.minikube/machines/minikube ...
💀  Removed all traces of the "minikube" cluster.

Further reading

We recommend that you complete Getting started with Triggers.

For more complex examples check: