Tekton - A Cloud Native CI/CD

Bharat Mallavarapu
4 min readMay 24, 2021

What is Tekton?
Tekton is a cloud-native solution for building CI/CD pipelines. It consists of Tekton Pipelines, which provides the building blocks, and of supporting components, such as Tekton CLI and Tekton Catalog, that make Tekton a complete ecosystem. Tekton is part of the CD Foundation, a Linux Foundation project.

Tekton is based on Kubernetes Custom Resources, that are an extension of Kubernetes API. Tekton provides us with a set of custom resources which help in creating Kubernetes style CI/CD resources. Tekton controllers help manage the CI/CD pipelines that are created.

Kubernetes Resources API are managed using predefined resources. We can extend our Kubernetes cluster by adding Custom Resources. State in a Kubernetes cluster is managed using a controller. Kubernetes splits the state into smaller parts instead of managing it as a whole. Each of these parts that are split will be managed by a separate controller. With Tekton, we have a Custom Resource controller which will extend Kubernetes cluster for CI/CD.

Benefits of Tekton:

  • Customizable: Tekton entities are fully customizable, allowing for a high degree of flexibility. Platform engineers can define a highly detailed catalog of building blocks for developers to use in a wide variety of scenarios.
  • Reusable: Tekton entities are fully portable, so once defined, anyone within the organization can use a given pipeline and reuse its building blocks. This allows developers to quickly build complex pipelines without “reinventing the wheel.”
  • Expandable: Tekton Catalog is a community-driven repository of Tekton building blocks. You can quickly create new and expand existing pipelines using pre-made components from the Tekton Catalog.
  • Standardized: Tekton installs and runs as an extension on your Kubernetes cluster and uses the well-established Kubernetes resource model. Tekton workloads execute inside Kubernetes containers.
  • Scalable: To increase your workload capacity, you can simply add nodes to your cluster. Tekton scales with your cluster without the need to redefine your resource allocations or any other modifications to your pipelines.

Tekton Pipelines:
Tekton Pipelines is a Kubernetes extension that installs and runs on your Kubernetes cluster. It defines a set of Kubernetes Custom Resources that act as building blocks from which you can assemble CI/CD pipelines. Once installed, Tekton Pipelines becomes available via the Kubernetes CLI (kubectl) and via API calls, just like pods and other resources.

Tekton Pipeline Entities:

  • Task
  • TaskRun
  • Pipeline
  • PipelineRun
  • PipelineResource

Task:

A Pipeline has certain steps that build, test and deploy an application. These steps are present in a task. Task is a Custom Resource Definition

A Task defines a work in a stage that needs to be executed and every task is launched on a Kubernetes cluster and every task runs as a pod and also has multiple steps.

A Step in a task is a series of commands that are necessary for building an application and are executed sequentially. Each step in a task runs as a container.

A Task can have inputs and outputs. An input can be PipelineResources and Parameters while an output can be PipelineResources

TaskRun:

A TaskRun is an instance of a task that is defined. It will help in executing a task with inputs and outputs. TaskRun has the ability to set values to parameters.

Pipeline:

Pipeline is a list of tasks when specified in an order will execute in the same order and help automate some part of the development process. It helps to link the inputs and outputs of a task. We can invoke a pipeline with the help of PipelineRun.

PipelineRun:

PipelineRun is an instance of a defined Pipeline. It helps in binding the inputs and outputs to a Pipeline. PipelineRun instantiates a Pipeline to execute the tasks listed. It provides the result of a Pipeline whether it is succeeded or failed.

PipelineResource:

PipelineResource is another type of Custom Resource defined by Tekton. PipelineResources are inputs and outputs associated with a CI/CD process. It abstracts resources such as git repository, container image etc.

An input can be a git repository or a container image which we specify in a task. An output can be an image pushed through image registry as a result of running all the tasks through a pipeline. A PipelineRun is reusable i.e. it can be used with different tasks.

For anyone who wish to learn more about Tekton and try it out, please find this GitHub repository and to start with tutorial, here is the pipelines tutorial.

--

--