Cloud Native 10 min read

Installing and Using Tektoncd Operator on Kubernetes

This guide explains how to install the Tektoncd Operator on a Kubernetes cluster, configure its CRDs, choose installation methods, customize component images, apply predefined profiles, and run a simple hello‑goodbye pipeline using Tekton tasks and PipelineRun objects.

DevOps Cloud Academy
DevOps Cloud Academy
DevOps Cloud Academy
Installing and Using Tektoncd Operator on Kubernetes

Tektoncd Operator is a Kubernetes extension that simplifies the installation, upgrade, and management of TektonCD Pipelines, Dashboard, Triggers, and other components by applying YAML manifests for each component.

The operator defines several Custom Resource Definitions (CRDs) such as TektonConfig , TektonPipeline , TektonTrigger , TektonDashboard , TektonResult , and TektonAddon , each responsible for configuring a specific Tekton component.

There are multiple ways to install the operator:

From Operator Hub (managed by the Operator Lifecycle Manager).

By applying a resource manifest directly from the Tektoncd Operator release page.

Using a custom manifest that overrides the default GCR images when they are inaccessible.

$ kubectl apply -f https://storage.googleapis.com/tekton-releases/operator/latest/release.yaml

If the default GCR images cannot be pulled, an alternative manifest can be used:

$ kubectl apply -f https://my-oss-testing.oss-cn-beijing.aliyuncs.com/k8s/tekton/operator/release.v0.60.0.yml

After installation, the operator creates a tekton-operator namespace containing the operator and webhook pods.

$ kubectl get pods -n tekton-operator
NAME                                 READY   STATUS    RESTARTS   AGE
tekton-operator-9d747548b-67t7m    2/2     Running   0          9m42s
tekton-operator-webhook-6cc769b85d-fssq9   1/1     Running   0          9m42s

Each Tekton component is represented by a CR; the top‑level TektonConfig CR creates the other component CRs based on the selected profile . The operator provides three built‑in profiles:

all – installs all components.

basic – installs only TektonPipeline and TektonTrigger.

lite – installs only TektonPipeline.

Example of applying the all profile:

# tekton-operator-profile-all.yaml
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonConfig
metadata:
  name: config
spec:
  profile: all
  targetNamespace: tekton-pipelines
  pruner:
    resources:
      - pipelinerun
      - taskrun
    keep: 100
    schedule: "0 8 * * *"
$ kubectl apply -f tekton-operator-profile-all.yaml
$ kubectl get tektonconfig
NAME    VERSION   READY   REASON
config  v0.60.0   True

The applied profile creates the tektonpipelines , tektontriggers , and tektondashboard components, which can be verified with:

$ kubectl get tektonpipelines
NAME      VERSION   READY   REASON
pipeline  v0.37.0   True

$ kubectl get tektontriggers
NAME     VERSION   READY   REASON
trigger  v0.20.1   True

$ kubectl get tektondashboard
NAME        VERSION   READY   REASON
dashboard   v0.27.0   True

Pods for these components run in the tekton-pipelines namespace. If the Dashboard image needs to be overridden, edit the deployment:

$ kubectl edit deploy tekton-dashboard -n tekton-pipelines
... 
    image: cnych/tekton-dashboard:v0.28.0
...

To demonstrate usage, a simple pipeline is created. First, define two Tasks ( hello and goodbye ) that echo messages, then a Pipeline that runs hello followed by goodbye :

# hello-task.yaml
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: hello
spec:
  steps:
    - name: hello
      image: bash:latest
      command:
        - echo
      args:
        - "Hello, world!"

# hello-goodbye-pipeline.yaml
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: hello-goodbye-pipeline
spec:
  tasks:
    - name: hello
      taskRef:
        name: hello
    - name: goodbye
      runAfter:
        - hello
      taskRef:
        name: goodbye

Apply the resources and verify their creation:

$ kubectl get pipeline
NAME                     AGE
hello-goodbye-pipeline   24s

$ kubectl get task
NAME      AGE
goodbye   101s
hello     107s

Finally, create a PipelineRun to execute the pipeline:

# hello-goodbye-pipeline-run.yaml
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  generateName: hello-goodbye-pipeline-
spec:
  pipelineRef:
    name: hello-goodbye-pipeline
$ kubectl create -f hello-goodbye-pipeline-run.yaml

When the PipelineRun is created, the two tasks run sequentially, printing "Hello, world!" and "goodbye". To uninstall Tekton, simply delete the TektonConfig object.

Cloud NativeCI/CDKubernetesOperatorpipelineTekton
DevOps Cloud Academy
Written by

DevOps Cloud Academy

Exploring industry DevOps practices and technical expertise.

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.