March 25, 2020 By Powell Quiring 3 min read

As a developer or administrator, learn how to use Tekton pipelines in your CI/CD pipelines in the IBM Cloud. 

IBM has been providing tools for DevOps and CI/CD for decades. One component of IBM Cloud DevOps is the Delivery Pipeline, which has recently been expanded to include Tekton 10.1. The open source Tekton Pipelines project is new and evolving and has support and active commitment from leading technology companies, including IBM, Red Hat, Google, and CloudBees.

See the following video for an overview of Tekton:

This multi-part tutorial will guide you through using this interesting technology. For a great overview, check out “Build and Deliver Using Tekton-Enabled Pipelines.”

Before you begin

Navigate to the tekton-toolchain GitHub repository and make a fork. I will use mine (https://github.com/powellquiring/tekton-toolchain) during the tutorial. When you see this, substitute in your fork.

Note: If you see warnings or errors that the Continuous Delivery service is required, you can either live with the warnings or create a Continuous Delivery service (Lite plan) for the region.

Pipelines of pipelines of pipelines…

Warning—the word pipeline is over loaded. A Delivery Pipeline is an IBM tool in the IBM Toolchain. The Tekton Pipeline is the open source project, and one of the Tekton Pipeline resources is named Pipeline. (Wow.)

Configure a simple Tekton Pipeline

This first blog post will explain how to configure a simple Tekton Pipeline. It will added to a Delivery Pipeline in a DevOps Toolchain.

Note: Public workers are only available in the Dallas region.

Visit the IBM Cloud in your browser. In the hamburger menu in the upper left, choose DevOps.

  • Verify that Toolchains is the selected panel on the left:
    • Set the Resource Group as desired (default is fine).
    • Leave Cloud Foundry Org unselected.
    • Set the Location to Dallas (Dallas is the only region with public workers).
  • Click Create a toolchain and then Build your own toolchain. Verify:
    • Select Region: Dallas
    • Select a resource group: default (or your desired resource group)
  • Click Add tool and choose GitHub:
  • Add tool and choose Delivery Pipeline:
    • name: whatever
    • Pipeline type: Tekton

As you can see, a Toolchain is a landing page that holds integrated tools. You have integrated two tools: GitHub and a Delivery Pipeline.

Click the Delivery Pipeline to open.

  • The Definitions panel on the left is selected. Definitions are going to identify the set of Tekton files that will contribute to this Delivery Pipeline. Contribute the files in the lab1-simple path (your fork)
  • Click the Worker panel. The default works great, and for me it was: (Beta)IBM Managed workers in DALLAS
  • Click the Triggers panel:
    • Add trigger
    • Manual Trigger
    • EventListener: the-listener
  • Save and then Close, and you are back to the Delivery Pipeline. Click Run Pipeline > Manual Trigger.

This demonstrates some cool stuff. All of the Tekton files in the github lab1-simple were added to the Delivery Pipeline. In this case, it was just the tekton.yaml file but all files with a .yaml or .yml extension are read by the Delivery Pipeline.

Open the lab1-simple/tekton.yaml file. The name of the trigger in the drop-down menu is the same as the EventListener.

apiVersion: tekton.dev/v1alpha1
kind: EventListener
metadata:
  name: the-listener

Click on the log entry created and you will see xx1, which matched the task name in the pipeline:

apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
  name: pipeline
spec:
  tasks:
    - name: xx1

You can see the task steps that were executed. No surprises. The steps are commands executed in the associated container and give you a feel for the environment. The ubuntu container image was supplied by hub.docker.com.

apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
  name: the-task
spec:
  steps:
    - name: echo
      image: ubuntu
      command:
        - echo
      args:
        - "01 version"
    - name: lslslash
      image: ubuntu

Note that the last few steps show that the file system is preserved between steps. Experiment some more to verify that the working directory is not maintained across tasks.

Learn more

There is a vibrant, open source community working on the Tekton Pipeline project, and this is a great chance to join the fun. Tekton has been integrated into the IBM DevOps environment, and you can leverage the IBM Cloud so that you can work on your business instead of your infrastructure. 

This is Part 1 of a multi-part tutorial series—more Tekton posts are coming to explain topics like variables, workspaces, and sharing.

Resources

Report a problem or ask for help

Get help fast directly from the IBM Cloud development teams by joining us on Slack.

Was this article helpful?
YesNo

More from Cloud

IBM Tech Now: April 8, 2024

< 1 min read - ​Welcome IBM Tech Now, our video web series featuring the latest and greatest news and announcements in the world of technology. Make sure you subscribe to our YouTube channel to be notified every time a new IBM Tech Now video is published. IBM Tech Now: Episode 96 On this episode, we're covering the following topics: IBM Cloud Logs A collaboration with IBM watsonx.ai and Anaconda IBM offerings in the G2 Spring Reports Stay plugged in You can check out the…

The advantages and disadvantages of private cloud 

6 min read - The popularity of private cloud is growing, primarily driven by the need for greater data security. Across industries like education, retail and government, organizations are choosing private cloud settings to conduct business use cases involving workloads with sensitive information and to comply with data privacy and compliance needs. In a report from Technavio (link resides outside ibm.com), the private cloud services market size is estimated to grow at a CAGR of 26.71% between 2023 and 2028, and it is forecast to increase by…

Optimize observability with IBM Cloud Logs to help improve infrastructure and app performance

5 min read - There is a dilemma facing infrastructure and app performance—as workloads generate an expanding amount of observability data, it puts increased pressure on collection tool abilities to process it all. The resulting data stress becomes expensive to manage and makes it harder to obtain actionable insights from the data itself, making it harder to have fast, effective, and cost-efficient performance management. A recent IDC study found that 57% of large enterprises are either collecting too much or too little observability data.…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters