Quick Start
TOC
Installation of Tekton Results
This document explains how to install Tekton Results using an existing database.
Currently, the built-in PostgreSQL database is not supported, please use an external database.
About external database please refer to Using PostgreSQL from Data Services
Prerequisites
-
Tekton Pipelines must be installed in the cluster.
TIPThe following instructions assume that you have installed Results into the
tekton-pipelinesnamespace by default.If you have installed it into a different namespace, please replace
tekton-pipelineswith your namespace. -
Create a database root password.
Users must generate a database root password and store it in a Kubernetes Secret before installation. By default, Tekton Results expects this
Secretto have the following attributes:- Namespace:
tekton-pipelines - Name:
tekton-results-postgres - Including the following fields:
POSTGRES_USER=<your_username>POSTGRES_PASSWORD=<your_password>
You can quickly generate a
Secretusing the following command: - Namespace:
-
Generate a certificate/key pair. Note: Any certificate management software can be used for this purpose!
Tekton Results expects the certificate/key pair to be stored in a TLS Kubernetes Secret named
tekton-results-tls.-
Generate a new self-signed certificate
TIPIf your
opensslversion is too low and does not support some parameters, please upgrade youropensslversion from openssl binaries . -
Create a new TLS Secret from the certificate.
-
-
Create a
PVCif you are usingPVCto store logs.- Please adjust the PVC size as needed.
Installing using operator CRD
:::details {title="Explanation of YAML fields"}
db_host: The host of the database.db_port: The port of the database.db_name: The name of the database.is_external_db: Whether to use an external database.true: Use an external database.
secret_name: The name of the secret containing the database account information.- This is the secret created in the previous step.
server_port: The port of the server.targetNamespace: The namespace where the Results is deployed.auth_disable: Whether to disable authentication.db_enable_auto_migration: Whether to enable automatic database migration.log_level: The level of the log.logs_api: Whether to enable the logs API.true: Enable the logs API.
logs_type: The type of the logs.File: Store logs in a file.
logs_path: The path of the logs.logs_buffer_size: The buffer size of the logs.logging_pvc_name: The name of the PVC to store the logs.- This is the PVC created in the previous step. :::
About more database configuration, please refer to PostgreSQL Configuration
After deployment, you can see that the status of results-api / results-retention-policy-agent / results-watcher is Running
Verify Functionality
Functionality can be verified through a simple taskrun.
1. Create a TaskRun resource
For air-gapped environments change the alpine image address to another present in the network
2. Wait for the task execution to complete
3. Use curl to query results
For more usage patterns, refer to the official documentation Tekton Results API
Prepare permissions
Verify permissions
Forward Ports
Proxy the service to the local port 8080
Get Token
Query Results
4. Use tkn-results CLI to query results
Preparing the CLI
tkn is a command-line tool for interacting with Tekton. You can download it from the official page.
You need to build tkn-results using golang.