Learn how to use the new IBM Cloud DevOps Toolchain Templates to automatically set up and use Tekton pipelines to build, test, and deploy your application.

IBM® Cloud Continuous Delivery includes open toolchains that automate the building and deployment of applications. Toolchain templates include specific sets of tool integrations that support development, deployment, and operations tasks.

In this blog post, we will use the new templates to create a toolchain that will use Tekton pipeline to deploy your application to a Kubernetes cluster.

About Tekton

Tekton pipelines is an open source project that you can use to configure and run continuous integration and continuous delivery pipelines within a Kubernetes cluster. Tekton pipelines are defined in yaml files, which are typically stored in a Git repository.

Prerequisites

Create the Toolchain

  • Go to the Toolchain creation page.
  • Select Delivery Pipeline – Tekton.
  • Select the Develop a Kubernetes app with Helm template (you may exercise other templates later):


  • Review the Toolchain’s default settings:
    • Toolchain name: You may choose a name of your choice.
    • Region: Ensure the Dallas region is selected (to benefit from IBM Managed Public Workers). Note: As of today, public workers are available only in Dallas region. If creating the Toolchain in another region, you will need to set-up and add your own Private Worker.
    • Resource Group: Keep the Default Resource Group
  • Review the Git Repo and Issue Tracking settings. Each toolchain comes with a sample app, but you can select another repo to use. Learn more about Track deployment of code changes option by reading this blog.
  • Click the Delivery Pipeline tab. These fields are displayed:
    • App name: Enter the name for your application. If you’d like, you can use the default value.
    • IBM Cloud API Key: Click on the New button next to the IBM Cloud API Key field and select OK in the resulting dialog box to create a new, unique API Key.
    • Container Registry Region: Select the region in which you want the container images to be created. The default setting is to use the same registry region and cluster region.
    • Container Registry Namespace: This namespace is your folder in the global image registry in a region, which is used to manage your set of images. Either enter or select a namespace. 
    • Cluster Region: Select the region for the target cluster. This region is the region of the Kubernetes cluster that you created at the start of the tutorial or the cluster in the shared account. 
    • Resource Group: Select the resource group for your delivery pipeline. For more information about Resource Groups, see “Best practices for organizing resources in a resource group.”
    • Cluster Name: Select the name of the Kubernetes cluster that you created at the start of the tutorial or the cluster in the shared account. 
    • Cluster Namespace: Use explicit namespaces in clusters to separate deployed resources. Use distinct namespaces to insulate deployments within the same Kubernetes cluster. You can leave this setting at its default prod value.
  • Note: The new pipeline type selector enables you to switch from “Classic” to Tekton pipeline:


  • Click Create. After a few moments, your new toolchain overview page opens:


The Tekton pipeline dashboard

  • Click on the Delivery Pipeline card to explore the Tekton pipeline dashboard:


  • See the following definitions of the options on the left-hand menu:
    • Definitions: This is where the different Tekton resources stored in repositories will be referenced (along with relevant branch/tag and path).
    • Worker: Tekton pipelines are executed by Workers. Ensure IBM Managed Worker is selected. If you intend to run your pipelines on a Private Worker and you have not added one to this toolchain yet, click here:


    • Triggers: This is where you specify what happens when a specified event occurs.
    • Environment properties: This allows you to store name value pairs for use in your pipeline.
  • More details about the various sections can be found in the documentation

Tekton resources definitions

IBM Cloud Continuous Delivery support for Tekton provides a set of Custom Resources extensions to Kubernetes to define pipelines:

  • Click the Definitions section of the pipeline. Each entry links to a repository, branch, and path hosting Tekton resources used by this pipeline:


  • Click on the simple-helm-toolchain link to open the Github repository. Switch to dual-template branch.
  • Go to the .pipeline directory and open the pipeline.yaml file to explore the various the set of tasks that compose this pipeline.
  • Explore more repositories or jump to the next step—committing your first changes.

Make, commit, and deploy a change

  • Back on the main Toolchain page, click the Orion Web IDE tile:


  • Navigate to the hello-helm project and edit app.js:


  • At line 28, modify the app’s welcome message and change the text to “IBM Cloud DevOps in action!”:


  • Click on the Git icon on the left-hand side:


  • Add a comment and commit your changes by clicking the Commit button on the right:


  • Push your changes to the Git repository:


  • Navigate back to your Toolchain and click on the Delivery Pipeline. Observe that the Pipeline has been triggered by your commit. 
  • Click on PipelineRun to view the pipeline tasks and steps execution details:


  • Explore the various steps logs.
  • Click on the deploy-to-kubernetes task, then click on the execute step.
  • Scroll down to the bottom of the log and locate the section:


  • Copy the application URL and paste it in a new tab to verify that your changes were deployed:


Summary

Congratulations! You created a Toolchain that uses Helm charts to deploy an app to a secure container in a Kubernetes cluster using a Tekton pipeline. You updated the app and pushed the updates to the Git repo. After the delivery pipeline deployed the app, you verified the update.

Going further

Add a manual trigger to your Tekton pipeline with the following steps:

  • Select the Triggers section, click the Add trigger button, and select Manual:


  • Keep the defaults and add Trigger properties:
    • Repository: The URL of the repository hosting the code to deploy.
    • Branch: The branch from which to fetch the code.
  • Save your changes:


  • Back on the PipelineRuns Dashboard, click the Run Pipeline button and trigger a manual run:


  • Observe that a new build has been triggered:


Additional resources

Report a problem or look for help

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

More from Cloud

Strengthening cybersecurity in life sciences with IBM and AWS

7 min read - Cloud is transforming the way life sciences organizations are doing business. Cloud computing offers the potential to redefine and personalize customer relationships, transform and optimize operations, improve governance and transparency, and expand business agility and capability. Leading life science companies are leveraging cloud for innovation around operational, revenue and business models. According to a report on mapping the cloud maturity curve from the EIU, 48% of industry executives said cloud has improved data access, analysis and utilization, 45% say cloud…

7 min read

Kubernetes version 1.27 now available in IBM Cloud Kubernetes Service

< 1 min read - We are excited to announce the availability of Kubernetes version 1.27 for your clusters that are running in IBM Cloud Kubernetes Service. This is our 22nd release of Kubernetes. With our Kubernetes service, you can easily upgrade your clusters without the need for deep Kubernetes knowledge. When you deploy new clusters, the default Kubernetes version remains 1.25 (soon to be 1.26); you can also choose to immediately deploy version 1.27. Learn more about deploying clusters here. Kubernetes version 1.27 In…

< 1 min read

Redefining the consumer experience: Diageo partners with SAP and IBM on global digital transformation

3 min read - In an era of evolving consumer preferences and economic uncertainties, the beverage industry stands as a vibrant reflection of changing trends and shifting priorities. Despite the challenges posed by inflation and the cost-of-living crisis, a dichotomy has emerged in consumer behavior, where individuals untouched by the crisis continue to indulge in their favorite beverages, while those directly affected pivot towards more affordable luxuries, such as a bottle of something special. This intriguing juxtaposition highlights the resilient nature of consumers and…

3 min read

IBM Cloud releases 2023 IBM Cloud for Financial Services Agreed-Upon Procedures (AUP) Report

2 min read - IBM Cloud completed its 2023 independent review of IBM Cloud services and processes. The review report demonstrates to its clients, partners and other interested parties that IBM Cloud services have implemented and adhere to the technical, administrative and physical control requirements of IBM Cloud Framework for Financial Services. What is the IBM Cloud Framework for Financial Services? IBM Cloud for Financial Services® is designed to build trust and enable a transparent public cloud ecosystem with features for security, compliance and…

2 min read