Skip to main content
This guide walks you through setting up a development environment for Tekton Pipelines and covers common development workflows.

Prerequisites

Before starting, you should familiarize yourself with:

Setting Up Development Environment

1. Setup GitHub Account

GitHub is used for source code management using SSH for authentication.
1

Create GitHub account

Create a GitHub account if you don’t already have one.
2

Setup SSH access

2. Install Required Tools

1

Install git

Install git for source control.
2

Install pre-commit

Install pre-commit to run git hooks locally:
3

Install Go

Install go - Tekton is built in Go.
Go version v1.15 or higher is recommended.
4

Install ko

Install ko to build and deploy container images.
ko version v0.5.1 or higher is required.
5

Install kubectl

Install kubectl to interact with Kubernetes.
The user interacting with your K8s cluster must be a cluster admin to create role bindings.
Google Cloud Platform example:
6

Install bash

Install bash v4 or higher for build scripts.On MacOS, use Homebrew to install a newer version.
7

Install go-licenses

Install go-licenses - used in e2e tests.

3. Install Optional Tools

yamllint is run against every PR as part of pre-commit. Install it so pre-commit can use it.
golangci-lint is run against every PR. Install and run it locally to iterate quickly on linter issues.
Linter findings depend on your Go version. Match the version in go.mod to match PR findings.
woke checks for offensive language in every PR. Install to run checks locally.
delve is needed for debugging the Tekton controller in VSCode or your IDE.

4. Configure Environment

Set these environment variables to build, deploy, and run Tekton with ko:
1

Set GOROOT (optional)

Set GOROOT to the Go installation location you want ko to use:
Only needed if you installed Go to a non-default location or have multiple Go versions.
2

Set KO_DOCKER_REPO

Set the docker repository for pushing developer images:Using Google Container Registry (GCR):
Using Docker Desktop (Docker Hub):
Using a self-hosted Docker Registry:
3

Add Go binaries to PATH (optional)

Add $HOME/go/bin to your system PATH:
Add these environment variables to your shell’s configuration files (e.g., ~/.bash_profile or ~/.bashrc).

5. Setup a Fork

1

Create a fork

Create a fork of the tektoncd/pipeline repository in your GitHub account.
2

Clone your fork

Tekton uses Go Modules, so you can clone to any location.
3

Configure remotes

6. Configure Container Registry

Docker Desktop provides seamless integration with Docker Hub. Configure Docker Desktop with your Docker ID and password in its dashboard.

Setup a Kubernetes Cluster

  • Kubernetes version 1.28 or later
  • 4 (virtual) CPU nodes
  • 8 GB of platform memory
  • Node autoscaling, up to 3 nodes
Kind is great for testing locally.
1

Install Docker

Install Docker.
2

Create cluster

3

Configure ko

The Tekton plumbing project provides a ‘tekton_in_kind.sh’ script that creates a cluster with Tekton components installed.

Building and Deploying

Install Pipeline

Deploy Tekton using your local code:

Verify Installation

Check that Tekton pipeline pods are running:

Redeploy Controller

As you make code changes, redeploy your controller:

Delete Pipeline

Clean up everything:
If using the same namespace as other components (dashboard, triggers), ko delete -R -f config/ deletes those components too.

Development Workflows

Iterating on Code Changes

While developing:
  1. Make your code changes
  2. Run update scripts as needed:
    • ./hack/update-deps.sh - Update dependencies
    • ./hack/update-codegen.sh - Update type definitions
    • ./hack/update-openapigen.sh - Update OpenAPI specs
  3. Redeploy the controller
  4. Verify the installation and check logs

Accessing Logs

Controller logs:
Webhook logs:
TaskRun/PipelineRun logs: See docs on accessing logs.

Testing

For comprehensive testing documentation, see the Testing Guide.

Adding New CRD Types

If you need to add a new CRD type:
1

Add YAML definition

Add a yaml definition in config/
2

Update cluster roles

Add the type to cluster roles in:
  • config/200-clusterrole.yaml
  • config/clusterrole-aggregate-edit.yaml
  • config/clusterrole-aggregate-view.yaml
3

Add Go structs

Add go structs in pkg/apis/pipeline/v1alpha1 implementing:
  • Defaultable interface
  • Validatable interface
4

Register with webhook

Register it with the webhook in cmd/webhook/main.go
5

Add to known types

Add the new type to the list of known types in pkg/apis/pipeline/v1alpha1/register.go
See the API compatibility policy for more information.

Debugging

ko has built-in support for the delve debugger.

Setup Debugging

1

Comment out probes

Update config/controller.yaml and comment out the liveness and readiness probes to prevent timeouts.
2

Build in debug mode

3

Forward debugging port

4

Add VSCode configuration

Add to launch.json:
Now you can attach to delve in VSCode, set breakpoints, and debug PipelineRun execution.