Skip to main content
Learn how to develop custom resolvers for Tekton Pipelines to integrate with proprietary storage systems or version control platforms.

What is a Resolver?

A Resolver is a program that runs in a Kubernetes cluster alongside Tekton Pipelines and “resolves” requests for Tasks and Pipelines from remote locations. For example, if a user submits a PipelineRun that needs a Pipeline YAML stored in a custom storage system, your resolver would be responsible for fetching the YAML and returning it to Tekton Pipelines. This pattern allows integration with any storage backend without modifying Tekton Pipelines itself.

Prerequisites

Before developing a custom resolver, you’ll need:
  • Proficiency in Go programming
  • Understanding of Tekton Resolution concepts
  • A Kubernetes cluster running Kubernetes 1.28 or later
  • kubectl installed
  • ko installed for building container images
  • An image registry for pushing images (or kind.local for local development)
  • Tekton Pipelines v0.41.0+ and remote resolvers installed

Architecture Overview

A resolver consists of:
  1. Go binary - Implements the resolver logic
  2. Kubernetes Deployment - Runs the resolver in the cluster
  3. Label-based routing - Directs ResolutionRequests to your resolver
  4. Framework integration - Uses Tekton’s resolver framework

Project Setup

Create the initial directory structure:

cmd/demoresolver

Contains the resolver implementation

config

Contains Kubernetes deployment manifests

Implementing the Resolver

Create cmd/demoresolver/main.go with the following framework:

Main Entry Point

Required Interface Methods

Your resolver must implement the framework.Resolver interface:

Initialize Method

GetName Method

GetSelector Method

This tells the framework that any ResolutionRequest with label "resolution.tekton.dev/type": "demo" should be routed to your resolver.

Validate Method

Resolve Method

Implementing ResolvedResource

Create a type that implements framework.ResolvedResource:

Best Practice: Implementing RefSource

For supply chain security (Tekton Chains integration), implement RefSource():

URI

Source location of the resource

Digest

Hash of the resource content

EntryPoint

Path to the specific resource

Deployment Configuration

Create config/demo-resolver-deployment.yaml:

Building and Deploying

Install dependencies:
Verify the code compiles:
Deploy to Kubernetes using ko:
Verify deployment:
Expected output:

Testing Your Resolver

Create test-request.yaml:
Submit the request:
Expected output:
View the resolved resource:
You should see the hard-coded pipeline YAML.

Using in PipelineRuns

Test your resolver with a real PipelineRun:

Advanced Topics

Accepting Parameters

Modify the Validate and Resolve methods to accept parameters:

Adding Configuration

Create a ConfigMap for resolver settings:

Error Handling

Return descriptive errors to help users troubleshoot:

Example: Real-World Resolver

For a production-ready example, see the Git Resolver source code.

Next Steps

Expand Resolve()

Implement fetching from your actual storage backend

Add Configuration

Create ConfigMaps for resolver settings

Implement Caching

Add caching for frequently accessed resources

Add Authentication

Implement authentication for protected backends

Resolver Template

For a complete resolver template to get started quickly, visit the resolver-template in the Tekton Pipeline repository.

Framework Differences

The previous framework (using pkg/resolution/resolver/framework) is deprecated. New resolvers should use pkg/remoteresolution/resolver/framework.

Key Changes

Best Practices

Validate Inputs

Always validate parameters and URLs thoroughly

Return Provenance

Implement RefSource() for supply chain security

Handle Errors

Provide clear, actionable error messages

Use Timeouts

Respect the global 1-minute timeout limit

Secure Credentials

Store API tokens in Kubernetes secrets

Test Thoroughly

Test with various inputs and edge cases
Start with a simple hard-coded resolver and gradually add features like parameter handling, authentication, and caching.