Prerequisites
Before starting, you should familiarize yourself with:- Kubernetes and Custom Resource Definitions (CRDs)
- Controller Logic - How Tekton extends Kubernetes
- Tekton Pipelines documentation
- Getting Started tutorial - Define and run Tasks and Pipelines
Setting Up Development Environment
1. Setup GitHub Account
GitHub is used for source code management using SSH for authentication.Create GitHub account
Create a GitHub account if you don’t already have one.
Setup SSH access
Setup GitHub access via SSH.
2. Install Required Tools
Install git
Install
git for source control.Install pre-commit
Install
pre-commit to run git hooks locally:Install Go
Install
go - Tekton is built in Go.Go version v1.15 or higher is recommended.
Install ko
Install
ko to build and deploy container images.ko version v0.5.1 or higher is required.Install kubectl
Install go-licenses
Install
go-licenses - used in e2e tests.3. Install Optional Tools
yamllint
yamllint
yamllint is run against every PR as part of pre-commit. Install it so pre-commit can use it.golangci-lint
golangci-lint
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
woke
woke checks for offensive language in every PR. Install to run checks locally.delve
delve
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 withko:
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.
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:
Add these environment variables to your shell’s configuration files (e.g.,
~/.bash_profile or ~/.bashrc).5. Setup a Fork
Create a fork
Create a fork of the
tektoncd/pipeline repository in your GitHub account.6. Configure Container Registry
- Docker Desktop
- Google 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
Recommended Minimum Configuration
- Kubernetes version 1.28 or later
- 4 (virtual) CPU nodes
- 8 GB of platform memory
- Node autoscaling, up to 3 nodes
- Kind
- Minikube
- Docker Desktop
- GKE
Kind is great for testing locally.
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:Development Workflows
Iterating on Code Changes
While developing:- Make your code changes
- 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
- Redeploy the controller
- Verify the installation and check logs
Accessing Logs
Controller logs:Testing
For comprehensive testing documentation, see the Testing Guide.Adding New CRD Types
If you need to add a new CRD type:Update cluster roles
Add the type to cluster roles in:
config/200-clusterrole.yamlconfig/clusterrole-aggregate-edit.yamlconfig/clusterrole-aggregate-view.yaml
Add Go structs
Add go structs in
pkg/apis/pipeline/v1alpha1 implementing:DefaultableinterfaceValidatableinterface
Debugging
ko has built-in support for the delve debugger.
Setup Debugging
Comment out probes
Update
config/controller.yaml and comment out the liveness and readiness probes to prevent timeouts.delve in VSCode, set breakpoints, and debug PipelineRun execution.