The Tekton Operator installs and manages the lifecycle of Tekton components (Pipelines, Triggers, Chains, Results, Dashboard, Pipelines as Code and more) on Kubernetes and OpenShift through a set of custom resources. For an overview of what it manages and how it is structured, see docs/TektonOperator.md.
Install these tools before you begin:
| Tool | Why | Check |
|---|---|---|
go |
Builds the operator (see go.mod for the minimum version) | go version |
git |
Source control | git --version |
kubectl |
Talks to the cluster | kubectl version --client |
ko |
Builds and deploys the operator images | ko version |
kustomize |
Renders the deployment manifests | kustomize version |
kind |
Runs the local development cluster | kind version |
docker or podman |
Container runtime | docker version / podman version |
ko and kustomize are installed automatically into .bin/ by the make targets if
they are not already on your PATH.
This is the supported and tested development path. It gives you a local kind cluster,
a local image registry and a running operator in a few commands.
-
Fork this repository and clone your fork, then add the upstream remote so you can sync later:
git clone git@github.com:${YOUR_GITHUB_USERNAME}/operator.git cd operator git remote add upstream git@github.com:tektoncd/operator.git git remote set-url --push upstream no_push
-
Point
koat the local registry thatmake dev-setupcreates:export KO_DOCKER_REPO="localhost:5000"
-
Create the cluster, the registry and deploy the operator:
make dev-setup
make dev-setupcreates akindcluster with a local registry and then runsmake applyfor you, so the operator is deployed by the time it finishes. It prints the location of the generated kubeconfig at the end. -
Point
kubectlat the new cluster:export KUBECONFIG="${HOME}/.kube/config.kind"
-
Install the Tekton components by creating a
TektonConfigcustom resource:make apply-cr
-
Verify it worked. The operator pods should be
Runningin thetekton-operatornamespace, theTektonConfigshould reconcile, and the components should come up intekton-pipelines:kubectl get pods -n tekton-operator kubectl get tektonconfig kubectl get pods -n tekton-pipelines
Ports used by the kind cluster (docker runtime):
8443- cluster API access80- ingress http443- ingress https
If a step fails, see Troubleshooting.
After you change code, rebuild and redeploy the operator with:
make applymake apply uses ko to build images, push them to KO_DOCKER_REPO and apply the
manifests. To build and load images locally without pushing to a registry, add
KO_FLAGS=--local:
make KO_FLAGS=--local applymake apply-cr creates the TektonConfig CR that tells the operator which components
to install, selected by profile:
lite— installs TektonPipelinebasic— installs TektonPipeline and TektonTrigger (the default)all— installs all Tekton components
Select a profile with the CR variable:
make CR=config/lite apply-cr
make CR=config/basic apply-cr
make CR=config/all apply-crkubectl logs -n tekton-operator deploy/tekton-operator -fRemove the installed components, then the operator:
make clean-cr
make cleanThe PR template asks you to run make test lint before submitting. Both run without a
cluster.
-
Unit tests:
make test -
Linters (
golangci-lintandyamllint):make lint
To lint a single Go package, pass
PKG, for examplemake lint-go PKG=./pkg/reconciler/kubernetes/tektonpipeline/.... -
End-to-end tests require a live cluster and take longer to run. See the test documentation for how to run them and what they need.
Run code generation whenever you change the API types under pkg/apis:
./hack/update-codegen.shThis regenerates the deepcopy functions and the typed client, informers and listers for the operator API group. Never hand-edit generated files — rerun the script instead, and commit the results alongside your API change.
After changing go.mod, refresh the vendored dependencies:
./hack/update-deps.shThe same targets work against OpenShift by setting TARGET=openshift:
make TARGET=openshift apply
make TARGET=openshift cleanThe OpenShift path deploys OpenShift-specific manifests and components (for example
TektonAddon) that do not exist on the Kubernetes path. If you use podman as your
container runtime, it is daemonless and needs a user-space socket before you build
images:
export CONTAINER_RUNTIME=podman
systemctl --user start podman.socket
export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock"With the podman runtime the kind cluster uses ports 8443 (API), 7080 (ingress
http) and 7443 (ingress https).
kind is the supported, tested development path. Any conformant cluster also works if it
meets the requirements:
- Kubernetes 1.28 or newer (see the compatibility matrix in the README)
cluster-adminprivileges- enough capacity to run the operator and the components you install
Use your provider's own documentation to create the cluster (GKE, EKS, AKS), then follow The development loop. Detailed, provider-specific walkthroughs are being moved out of this repo and will be published as dated blog posts on tekton.dev, where they can be updated without a repo change.
KO_DOCKER_REPOunset or wrong.make applyfails to push images. ExportKO_DOCKER_REPO="localhost:5000"for the local kind registry, or usemake KO_FLAGS=--local applyto skip pushing entirely.- Image pull failures against the local registry. Confirm the registry container is
running (
docker ps | grep kind-registry) and reachable atlocalhost:5000. Rerunmake dev-setupif the cluster and registry are out of sync. podmansocket not running. Start it withsystemctl --user start podman.socketand exportDOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock"before building.- Port conflicts. The kind cluster binds
8443, and80/443(docker) or7080/7443(podman). Free the port or stop the conflicting service before runningmake dev-setup. - Operator pod crashlooping. Check its logs first:
kubectl logs -n tekton-operator deploy/tekton-operator. - Stale CRDs after switching branches. Run
make cleanfollowed bymake applyto re-apply the manifests for the current branch.
- Read CONTRIBUTING.md and the tektoncd/community standards.
- Run
make test lintand make sure both pass before opening a PR. - Follow the commit message guidelines.
- Questions? Reach the maintainers in the
#operatorchannel on the Tekton Slack or at the operator working group.
These help you ramp up on the technology the operator is built on:
- Tekton Operator concepts and internals
- The knative.dev/pkg reconciler pattern this operator is built on
kofor building and deploying Go apps to Kubernetes- The Tekton "Hello World" tutorial
Ramp up on Custom Resource Definitions (CRDs), which this project uses to extend Kubernetes:
- The Kubernetes docs on Custom Resources — what "Resource" and "Controller" mean
- Understanding Kubernetes objects — core k8s object model
- API conventions — types (kinds) — "Objects" and "Lists"
- Extend the Kubernetes API with CustomResourceDefinitions — hands-on CRD tutorial
Ramp up on Tekton and Kubernetes operators: