Tekton Long-Term Log Storage
Tekton Results aims to help users logically group CI/CD workload history and separate out long term result storage away from the Pipeline controller. This allows you to:
- Provide custom Results metadata about your CI/CD workflows not available in the Tekton TaskRun/PipelineRun CRDs (for example: post-run actions).
- Group related workloads together (e.g. bundle related TaskRuns and PipelineRuns into a single unit).
- Make long-term result history independent of the Pipeline CRD controller, letting you free up etcd resources for Run execution.
- Store logs produced by the TaskRuns/PipelineRuns so that completed Runs can be cleaned to save resources.
Long-Term Log Access Workflow​
The following diagram illustrates the workflow for accessing long-term logs for pipelines in the KubeRocketCI Portal:
Install Tekton Results​
Tekton Results is deployed as part of the Tekton Pipelines installation. For installing Tekton Pipelines, we recommend using the add-ons approach. Here's an example of how to configure values.yaml before installation:
tekton:
createNamespace: true
enable: true
namespace: tekton-pipelines
Configuration​
We use Postgres operator to connect to Tekton results, but you can use any other external databases supported. Please align configuration accordingly to Tekton result documentation.
To configure long-term log storage for pipelines in the KubeRocketCI Portal, follow the steps below:
-
Storage sizes in the results-pg.yaml file define the allocated volumes for the Tekton Results PostgreSQL cluster:
-
Database instance storage
- Path:
spec.instances.dataVolumeClaimSpec.resources.requests.storage - Default:
2Gi - Description: Specifies the size of the main PostgreSQL data volume.
- Path:
-
Backup repository storage
- Path:
spec.backups.pgbackrest.repos.volume.volumeClaimSpec.resources.requests.storage - Default:
2Gi - Description: Specifies the size of the pgBackRest backup repository volume.
- Path:
-
-
Storage and retention settings in the results.yaml file define how Tekton Results result records are retained in the database and how related storage is configured:
-
Log storage size
- Path:
PersistentVolumeClaim.spec.resources.requests.storage - Default:
5Gi - Description: Specifies the allocated disk size for storing pipeline logs.
- Path:
-
Retention period
- Path:
ConfigMap.data.defaultRetentionintekton-results-config-results-retention-policy - Default:
"30"days - Description: Defines how long log files are retained before being automatically removed.
- Path:
-
Cleanup schedule
- Path:
ConfigMap.data.runAtintekton-results-config-results-retention-policy - Default:
"0 18 * * *0*" - Description: Specifies the cron expression that determines when automated log cleanup runs (daily at 6:00 PM UTC).
- Path:
-
The retention policy agent removes only database records from PostgreSQL. It does not delete associated log files stored on persistent volumes, S3, or GCS backends. As a result, log data may remain on disk and consume storage even after the corresponding records are expired.
-
To remove physical log files from PVCs (not just database records), use the settings in the results-clean-old-logs-cronjob.yaml file:
-
Cleanup schedule
- Path:
spec.schedule - Default:
"0 18 * * *" - Description: Specifies the cron expression that determines when the CronJob runs (daily at 6:00 PM UTC).
- Path:
-
Physical log retention (days)
- Path:
spec.jobTemplate.spec.template.spec.containers.command(the-mtime +Nvalue in thefindcommand) - Default:
30days - Description: Physical log files in
/tekton-results/logs/older than this many days are deleted from the PVC. The value is the number in-mtime +N(e.g.+30keeps files for 30 days).
- Path:
-
In this example, the PGO (PostgreSQL Operator) is used for the Tekton Results database.