Skip to main content
Tekton is a Kubernetes-native CI/CD system. Rather than running an external CI server, Tekton runs as custom resources inside your cluster: controllers, Pipelines, Tasks, TaskRuns, and PipelineRuns all live in Kubernetes. Key concepts at a glance: In this guide you’ll:
  • Verify Tekton is running in your cluster.
  • Create a minimal Task and run it.
  • Make the Task reusable with parameters.
  • Build a multi-step Task (clone → build → test).
  • Add a deploy Task and wire everything into a Pipeline.
  • Run the Pipeline and view logs.
You need kubectl access to the cluster and the tkn CLI installed/configured to follow the examples that use tkn commands and --showlog. See the Tekton docs and Kubernetes docs linked in the References section below.
Examples assume resources are created in the ci-pipelines namespace. Create it beforehand if it doesn’t exist: kubectl create namespace ci-pipelines. Ensure your user has the necessary RBAC permissions to create Tekton resources and view logs.

Verify Tekton Pipelines is running

Check the Tekton pods in the tekton-pipelines namespace:
Example output:
If the controllers and webhook are up and Running, you’re ready to create Tasks.

Create a minimal Task

Create hello-task.yaml with a single step that prints a message:
Apply the Task:
Start the Task and stream logs with tkn:
Example output:
This TaskRun is an instantiation of the Task we defined.

Make the Task reusable with a parameter

Replace the hard-coded message with a message parameter so the Task can be reused:
Apply the updated Task:
Start the Task without passing a parameter — it will use the default:
Output:
Pass a custom message using -p:
Output:
Note: the -p parameter format is -p name="value".

Create a multi-step build Task

A realistic CI Task runs multiple sequential steps (clone → build → test). Define a build-task that accepts an app-name parameter and runs three steps that print indicative messages: build-task.yaml:
Apply the Task:
Start the TaskRun and pass app-name:
Output (steps run sequentially):
Each step runs in sequence; choose images tailored to the step (e.g., a git image for clone, build tool images for compilation, test runners for tests).

Create a deploy Task

Create a Task that deploys a named app to an environment. It accepts app-name and environment (default staging). deploy-task.yaml:
Apply it:

Wire Tasks into a Pipeline

Create a Pipeline that runs build-task first, then deploy-task. The Pipeline accepts app-name and target-env, and passes them into the Tasks. pipeline.yaml:
Apply the Pipeline:
Start a PipelineRun and stream logs:
Expected output:
The PipelineRun executed the build Task (three sequential steps) followed by the deploy Task. You can inspect TaskRun logs and statuses from the CLI or Dashboard.

Tekton Dashboard

Tekton provides a Dashboard UI for visualizing pipelines and runs. From the Dashboard you can:
  • View Pipelines, PipelineRuns, Tasks, and TaskRuns.
  • Inspect logs, parameters, statuses, and related Pods.
  • Instantiate TaskRuns and PipelineRuns (subject to cluster RBAC).
The Dashboard complements CLI workflows and is useful for debugging and auditing CI/CD runs.

Next steps and extensions

Once you master Tasks and Pipelines:
  • Replace demo echo scripts with real clone/build/test/deploy steps.
  • Add Workspaces to share files/artifacts between steps.
  • Integrate image registries, results, conditions, or custom cluster resources.
  • Secure access via RBAC and configure Tekton Triggers for event-driven runs.

Watch Video

Practice Lab