Cloud Native 9 min read

How to Install and Run Tekton Pipelines on Kubernetes: A Step‑by‑Step Guide

This article walks you through installing Tekton pipelines on a Kubernetes cluster, including installing specific versions, verifying CRDs, creating and executing simple Tasks and TaskRuns, using the Tekton CLI, and setting up the Tekton Dashboard, with commands and code snippets for each step.

Ops Development Stories
Ops Development Stories
Ops Development Stories
How to Install and Run Tekton Pipelines on Kubernetes: A Step‑by‑Step Guide

Hello, I’m Qiao Ke. Starting today I will share a series of articles on Tekton, summarizing my learning and hoping to help anyone interested in Tekton.

Installation

Tekton can be installed easily with the official release files. To install the latest version:

<code>kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml</code>

If your environment cannot access the public registry, download the images elsewhere and push them to a private registry.

To install a specific version, e.g.,

v0.32.1

:

<code>kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.32.1/release.yaml</code>

Make sure your Kubernetes version is compatible; for example, with Kubernetes 1.19.16 I installed Tekton 0.29.1.

Run Tests

After installation, you can list the Tekton CRDs that were added:

<code># kubectl get crd | grep tekton
clustertasks.tekton.dev               2022-02-28T06:15:38Z
conditions.tekton.dev                2022-02-28T06:15:38Z
extensions.dashboard.tekton.dev      2022-02-28T06:18:40Z
pipelineresources.tekton.dev         2022-02-28T06:15:38Z
pipelineruns.tekton.dev              2022-02-28T06:15:38Z
pipelines.tekton.dev                 2022-02-28T06:15:38Z
runs.tekton.dev                      2022-02-28T06:15:38Z
taskruns.tekton.dev                  2022-02-28T06:15:38Z
tasks.tekton.dev                     2022-02-28T06:15:38Z</code>

And the Tekton pods that are running:

<code># kubectl get po -n tekton-pipelines
NAME                                 READY   STATUS    RESTARTS   AGE
tekton-pipelines-controller-75c456df85-qxvq2   1/1     Running   0          6m57s
tekton-pipelines-webhook-5bc8d6b7c4-w6pdn      1/1     Running   0          8m</code>

Create a simple Task that prints "Hello World!":

<code>apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: hello
spec:
  steps:
  - name: hello
    image: ubuntu
    command:
    - echo
    args:
    - "Hello World!"</code>

Apply the Task:

<code># kubectl apply -f test-task.yaml</code>

Verify the Task exists:

<code># kubectl get task
NAME   AGE
hello  20h</code>

Run the Task with a TaskRun:

<code>apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: hello
spec:
  taskRef:
    name: hello</code>
<code># kubectl apply -f taskrun.yaml</code>

Check the TaskRun status:

<code># kubectl get taskruns.tekton.dev
NAME    SUCCEEDED   REASON      STARTTIME   COMPLETIONTIME
hello   True        Succeeded   41s         26s</code>

Inspect the pod created by the TaskRun and view its logs:

<code># kubectl get po
NAME                READY   STATUS      RESTARTS   AGE
hello-pod-s86lh      0/2     Completed   1          98s

# kubectl logs hello-pod-s86lh
Hello World!</code>

The pod status is

Completed

, similar to a finished Kubernetes Job.

Install Tekton CLI

Download and install the Tekton command‑line tool:

<code>wget https://github.com/tektoncd/cli/releases/download/v0.22.0/tkn_0.22.0_Linux_x86_64.tar.gz
tar xf tkn_0.22.0_Linux_x86_64.tar.gz
mv tkn /usr/local/bin/</code>

After installation, view the help output:

<code># tkn --help
CLI for tekton pipelines

Usage:
  tkn [flags]
  tkn [command]

Available Commands:
  bundle          Manage Tekton Bundles
  clustertask     Manage ClusterTasks
  clustertriggerbinding  Manage ClusterTriggerBindings
  condition       Manage Conditions
  eventlistener   Manage EventListeners
  hub             Interact with tekton hub
  pipeline        Manage pipelines
  pipelinerun     Manage PipelineRuns
  resource        Manage pipeline resources
  task            Manage Tasks
  taskrun         Manage TaskRuns
  triggerbinding  Manage TriggerBindings
  triggertemplate Manage TriggerTemplates

Other Commands:
  completion      Prints shell completion scripts
  version         Prints version information

Flags:
  -h, --help   help for tkn

Use "tkn [command] --help" for more information about a command.</code>

List all Tasks:

<code># tkn task list
NAME               DESCRIPTION   AGE
build-and-push     20 hours ago
hello              21 hours ago
test               21 hours ago</code>

Install Tekton Dashboard

Deploy the Tekton Dashboard for a user‑friendly UI:

<code>kubectl apply --filename https://github.com/tektoncd/dashboard/releases/latest/download/tekton-dashboard-release.yaml</code>

After installation, the dashboard UI looks like this:

Tekton Dashboard screenshot
Tekton Dashboard screenshot

This article covered the basic installation steps for Tekton, its CLI, and the Dashboard. The official documentation provides more details, and future articles will explore Tekton pipelines, advanced usage, and migration from Jenkins.

CLIcloud-nativeCI/CDkubernetesinstallationTekton
Ops Development Stories
Written by

Ops Development Stories

Maintained by a like‑minded team, covering both operations and development. Topics span Linux ops, DevOps toolchain, Kubernetes containerization, monitoring, log collection, network security, and Python or Go development. Team members: Qiao Ke, wanger, Dong Ge, Su Xin, Hua Zai, Zheng Ge, Teacher Xia.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.