In modern continuous integration continuous delivery (CI/CD) environments, pipelines generate a vast amount of execution data including logs, task outputs and metadata. Without proper observability, debugging failures and analyzing the pipeline performance becomes difficult.
Tekton Results solves this problem by providing a centralized way to store, query, and analyze pipeline execution data in Red Hat OpenShift Pipelines. Tekton Results is an extension for Red Hat OpenShift Pipelines that enables long-term storage, indexing, and retrieval of completed PipelineRun and TaskRun records.
In this blog, let us explore the following activities:
- Understand Tekton and Tekton Results
- Install and configure Tekton Results
- Store pipeline logs using external storage
- Query and inspect pipeline execution data
Before we begin, let us delve deeper into what exactly is Tekton and how it connects to Tekton Results.
Tekton
Tekton is an open source, Kubernetes-native framework for building CI/CD systems. It allows developers to define pipelines using Kubernetes resources and run them across cloud environments.
Red Hat OpenShift Pipelines is built on Tekton and provides a cloud-native CI/CD solution for OpenShift.
Tekton consists of the following components:
- Task: A single unit of work
- Pipeline: A collection of tasks
- TaskRun: Execution of task
- PipelineRun: Execution of a pipeline
These components enable scalable and reusable CI/CD workflows.
Tekton Results
Tekton Results is a service that captures and stores execution data generated by Tekton pipelines. It stores metadata generated by PipelineRun, TaskRun details, execution logs, status and timestamps.
Without Tekton Results, pipeline data is short-lived and logs become difficult to retrieve later. With Tekton Results you get persistent storage of pipeline history, you can query results using APIs and the OpenShift Pipelines command-line interface (CLI). Thus, you gain deeper observability into CI/CD workflows.
Tekton Results architectural diagram
The following architectural diagram provides a visual representation of the fundamental structure of Tekton Results. It illustrates the key components and their interactions within Tekton Results.

Tekton Results workflow involves the following stages:
- A developer triggers a pipeline.
- Tekton creates a PipelineRun and multiple TaskRuns.
- The
tekton-results-watcher service monitors the PipelineRun and TaskRun resources and stores their records in Tekton Results.
- Data is sent to Tekton Results in API.
- Metadata is stored in the database (PostgreSQL).
- Logs are stored in external storage (GCS, S3).
- Users query results using CLI -
opc, Tekton (tkn), or REST API.
Installing Tekton Results
Perform the following steps to install Tekton Results.
Step 1: Verify OpenShift Pipelines installation
Check if the OpenShift Pipelines operator is installed using the following command:
oc get tektonconfig
Example output:
If the command returns a TektonConfig resource with the READY status as True, it means that the Tekton Operator is successfully installed and is operational.
NAME VERSION READY
config 1.16.0 True

Step 2: Configure SSL and secrets
Tekton Results exposes a secure REST API, and therefore, a Secure Sockets Layer (SSL) configuration is required. Perform the following steps to configure SSL and secrets.
-
Set a namespace.
export NAMESPACE="openshift-pipelines"

-
Create a PostgreSQL secret.
-
Ccreareate a Kubernetes secret containing the PostgreSQL username and password used by Tekton Results.
oc create secret generic tekton-results-postgres \
-n $(NAMESPACE) \
--from-literal=POSTGRES_USER=result \
--from-literal= POSTGRES_PASSWORD=${POSTGRES_PASSWORD}= \
$(openssl rand -base64 20)

-
Generate a self-signed SSL/TLS certificate and private key to secure communication with the Tekton Results API service.
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/CN=tekton-results-api \ service.${NAMESPACE}.svc.cluster.local" \
-addext "subjectAltName = DNS:tekton-results-api-service.${NAMESPACE}.svc.cluster.local"

-
Create the TLS certificates.
Create a Kubernetes TLS secret using the generated certificate and private key, enabling secure HTTPS communication for the Tekton Results API service.
oc create secret tls -n ${NAMESPACE} tekton-results-tls \
--cert=cert.pem --key=key.pem

Step 3: Configure log storage
Tekton Results stores logs externally for scalability. Therefore, we must create a storage for logging information. Here, we are configuring Google Cloud Storage.
oc create secret generic gcs-credentials \
--from-file=$HOME/.config/gcloud/application_default_credentials.json -n openshift-pipelines
Step 4: Create Tekton Results custom resource
- Apply the Tekton Results configuration.
Apply the TektonResult custom resource to install and configure the Tekton Results service with the required database, storage, logging, and networking settings.
cat <<EOF | oc apply -f -
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonResult
metadata:
name: result
spec:
targetNamespace: openshift-pipelines
logs_api: true
log_level: debug
db_port: 5432
db_host: tekton-results-postgres-service.openshift-pipelines.svc.cluster.local
logs_path: /logs
logs_type: GCS
logs_buffer_size: 2097152
auth_disable: true
tls_hostname_override: tekton-results-api-service.openshift-pipelines.svc.cluster.local
db_enable_auto_migration: true
server_port: 8080
prometheus_port: 9090
gcs_creds_secret_name: gcs-credentials
gcs_creds_secret_key: application_default_credentials.json
gcs_bucket_name: results-testing
EOF

- Create a route to expose the Tekton Results API.
The Tekton Results API is exposed as an internal Kubernetes service by default. To access it from outside the cluster using tools such as opc, create an OpenShift route that exposes the API service.
oc create route -n ${NAMESPACE} passthrough tekton-results-api-service --service=tekton-results-api-service --port=8080

Step 5: Verify installation
-
Wait for the Tekton Results installation to complete by verifying that the associated TektonInstallerSet reaches the Ready condition.
oc wait --for=condition=Ready tektoninstallerset –l \ operator.tekton.dev/type=result
If the installation is successful, the command returns a message with the Ready state indicating that all required components have reached the ready state (similar to the one in the following screenshot).

-
Run the following command to verify that Tekton Results has been installed successfully:
oc get tektonresults.operator.tekton.dev
If the installation is successful, the READY column displays True, indicating that the Tekton Results custom resource has been successfully reconciled by the OpenShift Pipelines Operator and the required Tekton Results components have been deployed successfully.
Example output:
NAME VERSION READY
result v0.11.0 TRUE

Step 6: Query Tekton Results
-
Set the API endpoint.
To query Tekton Results using the opc or the oc command, you first need to set the RESULTS_API environment variable. This variable should point to the Tekton Results API route. You can do this by running the following command:
RESULTS_API=$(oc get route tekton-results-api-service -n openshift-pipelines --no-headers -o custom-columns=":spec.host"):443
-
Set a unique namespace name.
Set the NAMESPACE environment variable to a unique namespace name using Bash's built-in $RANDOM variable. This helps avoid naming conflicts when creating a temporary namespace for the installation.
export NAMESPACE=test$RANDOM

-
Create the TaskRun component with Tekton Results.
To ensure that Tekton Results is correctly capturing the TaskRun metadata and logs, we start by creating a simple Task and TaskRun components. This task simulates an image build and push workflow by printing an image URL and image digest and then storing both the values as Tekton Task results.
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: create-image
spec:
results:
- name: IMAGE_URL
description: Image URL
- name: IMAGE_DIGEST
description: Image digest
steps:
- name: create-image
image: registry.access.redhat.com/ubi9/ubi-minimal
script: |
#!/usr/bin/env sh
set -eu
IMAGE="gcr.io/foo/bar"
DIGEST="sha256: <64-character-digest>"
echo "[create-image] ${IMAGE}"
echo "[create-image] ${DIGEST}"
printf "%s" "${IMAGE}" > $(results.IMAGE_URL.path)
printf "%s" "${DIGEST}" > $(results.IMAGE_DIGEST.path)
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
generateName: build-push-run-output-image-
spec:
taskRef:
name: create-image
-
Apply the task.
oc create -f task-output-image.yaml

-
Query Tekton Results.
-
Run the following command to list the Tekton Results:
opc results list --insecure --addr ${RESULTS_API} ${NAMESPACE}

-
Run the following command to view the Tekton Results details:
tkn tr describe --last -o jsonpath={.metadata.annotations}

-
Search for all the records in Tekton Results.
opc results records list \
--insecure \
--addr ${RESULTS_API} ${NAMESPACE}/results/<result-id>

-
Inspect a specific record in Tekton Results.
You can retrieve the details of a specific record stored in Tekton Results by specifying its result ID and record ID. This command returns the complete record metadata, including the record type, timestamps, and associated log or execution data.
opc results records get \
--insecure \
--addr ${RESULTS_API} <result-id>/records/<record-id>

Benefits of Tekton Results
Using Tekton Result provides the following benefits:
- Provides a long-term record of pipeline runs
- Allows deeper observability into CI/CD workflows
- Enables faster debugging with centralized logs
- Provides API-driven access to pipeline data
- Allows scalable storage using Google Cloud Storage
- Supports audit and compliance requirements
Conclusion
This blog aimed at serving as a comprehensive guide to implement and understand Tekton Results for observability in OpenShift Pipelines. Hope it helped you to understand the core concepts of Tekton and Tekton Results. By using Tekton Results, you can achieve better visibility into the CI/CD workflows, simplify debugging, and maintain a reliable history of pipeline activities. Ultimately, this enables more efficient, scalable, and observable DevOps practices. If you followed our steps of installing and configuring the service and illustration on how to query and analyze pipeline execution data effectively, do let us know how it went.
AI disclosure: Portions of this blog were generated with support from an AI assistant. The author has reviewed, tested, and refined all material to ensure accuracy, completeness, and compliance with IBM's technical and editorial standards.