Cloud Native 13 min read

Master Tekton: Install and Run Kubernetes‑Native CI/CD Pipelines in Minutes

This guide explains what Tekton is, why a Kubernetes‑native CI/CD solution is advantageous, and provides step‑by‑step instructions—including required images, YAML manifests, and command‑line examples—to install Tekton, define tasks and pipelines, run a Go test pipeline, and troubleshoot common issues.

Full-Stack DevOps & Kubernetes
Full-Stack DevOps & Kubernetes
Full-Stack DevOps & Kubernetes
Master Tekton: Install and Run Kubernetes‑Native CI/CD Pipelines in Minutes

Overview

Tekton is an open‑source, Kubernetes‑native CI/CD system. All pipeline objects are represented as Custom Resource Definitions (CRDs) that live inside the cluster, so pipelines can be managed with the same tools used for any other Kubernetes resource.

Why a Kubernetes‑native CI/CD tool?

Configuration is stored as CRDs, making it easy to query, version and back up.

Pipeline definitions can be decoupled from their inputs and referenced by name.

The core controller is lightweight; additional components such as Dashboard, Triggers and CLI can be added as needed.

Resources are reusable and composable, simplifying the creation of project‑specific pipelines.

Installation

Prepare Tekton images . The example images used in the tutorial are:

xianchao/tekton-controller:v0.12.0
xianchao/tekton-webhook:v0.12.0

If the cluster has no internet access, download the image tarballs from the provided Baidu Cloud link (extraction code yvcb) and load them on each node with docker load -i <image>.tar.gz.

Apply the Tekton release manifest . Tekton requires a Kubernetes version >= 1.16 (the tutorial was tested on v1.18.2). Download release.yaml (same Baidu link) and run: kubectl apply -f release.yaml Verify the installation . After a few seconds the controller and webhook pods should be running in the tekton-pipelines namespace: kubectl get pods -n tekton-pipelines Typical output:

NAME                                         READY   STATUS    RESTARTS   AGE
tekton-pipelines-controller-xxxxxx   1/1     Running   0          2m30s
tekton-pipelines-webhook-xxxxxx      1/1     Running   0          2m30s

Core Tekton resources

Task : A template that defines a series of steps (each step runs in its own pod).

TaskRun : An execution of a Task with concrete inputs.

Pipeline : An ordered collection of Tasks, PipelineResources and parameters.

PipelineRun : An execution of a Pipeline.

PipelineResource : Describes external inputs or outputs such as a Git repository or a container image.

Example: Running a simple Go test pipeline

The source code and Dockerfile for the demo are hosted at https://github.com/luckylucky421/tekton-demo.

1. Define a Task

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: test
spec:
  resources:
    inputs:
    - name: repo
      type: git
  steps:
  - name: run-test
    image: golang:1.14-alpine
    workingDir: /workspace/repo
    command: ["go"]
    args: ["test"]

The repo input uses the built‑in git resource type; Tekton automatically clones the repository into /workspace/repo.

2. Create a PipelineResource for the Git repository

apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
  name: tekton-demo-git
spec:
  type: git
  params:
  - name: url
    value: https://github.com/luckylucky421/tekton-demo
  - name: revision
    value: master

3. Create a TaskRun that binds the Task and the PipelineResource

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: test-run
spec:
  taskRef:
    name: test
  resources:
    inputs:
    - name: repo
      resourceRef:
        name: tekton-demo-git

Apply each manifest:

kubectl apply -f task.yaml
kubectl apply -f pipelineresource.yaml
kubectl apply -f taskrun.yaml

4. Monitor execution

# Check the TaskRun status
kubectl get taskrun test-run

# Inspect the pods created by Tekton
kubectl get pods -n tekton-pipelines

# If a pod fails with ImagePullBackOff, preload the required images on every node:
# docker load -i tekton-controller.tar.gz
# docker load -i tekton-webhook.tar.gz
# docker load -i tekton-entrypoint.tar.gz
# ... (other Tekton helper images)

5. View logs

kubectl logs -n tekton-pipelines -l tekton.dev/taskRun=test-run --all-containers

The logs show the Git clone operation followed by the Go test output. A successful run ends with PASS and the TaskRun status becomes Succeeded.

Troubleshooting common issues

Image pull failures : When the cluster cannot reach an external registry, manually load the Tekton images (controller, webhook, entrypoint, git‑init, etc.) on each node using docker load.

Pod stuck in Init:ErrImagePull : Verify the image name and tag, ensure the image is present on the node, or adjust the image pull policy.

TaskRun stuck in Pending : Check that the tekton-pipelines namespace has sufficient resources and that the ServiceAccount has the required permissions.

Result

When the pipeline completes, the Tekton pod transitions to Completed and the TaskRun shows Succeeded. The Go test output confirms that the code in the repository builds and passes its unit tests.

References

https://tekton.dev/

https://www.arthurkoziel.com/creating-ci-pipelines-with-tekton-part-1/

https://www.qikqiak.com/post/create-ci-pipeline-with-tekton-1/

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

ci/cdKubernetesDevOpsPipelinetekton
Full-Stack DevOps & Kubernetes
Written by

Full-Stack DevOps & Kubernetes

Focused on sharing DevOps, Kubernetes, Linux, Docker, Istio, microservices, Spring Cloud, Python, Go, databases, Nginx, Tomcat, cloud computing, and related technologies.

0 followers
Reader feedback

How this landed with the community

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.