Chapter 1. Using Tekton Results for OpenShift Pipelines observability
Tekton Results is a service that archives the complete information for every pipeline run and task run. You can prune the PipelineRun
and TaskRun
resources as necessary and use the Tekton Results API or the opc
command line utility to access their YAML manifests as well as logging information.
1.1. Tekton Results concepts Copy linkLink copied to clipboard!
Tekton Results archives pipeline runs and task runs in the form of results and records.
For every PipelineRun
and TaskRun
custom resource (CR) that completes running, Tekton Results creates a record.
A result can contain one or several records. A record is always a part of exactly one result.
A result corresponds to a pipeline run, and includes the records for the PipelineRun
CR itself and for all the TaskRun
CRs that were started as a part of the pipeline run.
If a task run was started directly, without the use of a pipeline run, a result is created for this task run. This result contains the record for the same task run.
Each result has a name that includes the namespace in which the PipelineRun
or TaskRun
CR was created and the UUID of the CR. The format for the result name is <namespace_name>/results/<parent_run_uuid>
. In this format, <parent_run_uuid>
is the UUUD of a pipeline run or else of a task run that was started directly.
Example result name
results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed
results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed
Each record has a name that includes name of the result that contains the record, as well as the UUID of the PipelineRun
or TaskRun
CR to which the record corresponds. The format for the result name is <namespace_name>/results/<parent_run_uuid>/results/<run_uuid>
.
Example record name
results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/records/e9c736db-5665-441f-922f-7c1d65c9d621
results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/records/e9c736db-5665-441f-922f-7c1d65c9d621
The record includes the full YAML manifest of the TaskRun
or PipelineRun
CR as it existed after the completion of the run. This manifest contains the specification of the run, any annotation specified for the run, as well as certain information about the results of the run, such as the time when it was completed and whether the run was successful.
While the TaskRun
or PipelineRun
CR exists, you can view the YAML manifest by using the following command:
oc get pipelinerun <cr_name> -o yaml
$ oc get pipelinerun <cr_name> -o yaml
Tekton Results preserves this manifest after the TaskRun
or PipelineRun
CR is deleted and makes it available for viewing and searching.
Example YAML manifest of a pipeline run after its completion
You can access every result and record by its name. You can also use Common Expression Language (CEL) queries to search for results and records by the information they contain, including the YAML manifest.
You can configure Tekton Results to facilitate forwarding the logging information of all the tools that ran as a part of a pipeline or task to LokiStack. You can then query Tekton Results for logging information of the task run associated with a Tekton Results record.
You can also query results and logs by the names of pipeline runs and task runs.
1.2. Configuring Tekton Results Copy linkLink copied to clipboard!
After you install OpenShift Pipelines, Tekton Results is enabled by default.
However, if you want to store and access logging information for your pipeline runs and task runs, you must configure forwarding this information to LokiStack.
You can optionally complete additional configuration for Tekton Results.
1.2.1. Configuring LokiStack forwarding for logging information Copy linkLink copied to clipboard!
If you want to use Tekton Results to query logging information for task runs, you must install LokiStack and OpenShift Logging on your OpenShift Container Platform cluster and configure forwarding of the logging information to LokiStack.
If you do not configure LokiStack forwarding for logging information, Tekton Results does not store this information or provide it from the command-line interface or API.
Prerequisites
-
You installed the OpenShift CLI (
oc
) utility. - You are logged in to your OpenShift Container Platform cluster as a cluster administrator user.
Procedure
To configure LokiStack forwarding, complete the following steps:
- On your OpenShift Container Platform cluster, install LokiStack by using the Loki Operator and also install the OpenShift Logging Operator.
Create a
ClusterLogForwarder.yaml
manifest file for theClusterLogForwarder
custom resource (CR) with one of the following YAML manifests, depending on whether you installed OpenShift Logging version 6 or version 5:YAML manifest for the
ClusterLogForwarder
CR if you installed OpenShift Logging version 6Copy to Clipboard Copied! Toggle word wrap Toggle overflow YAML manifest for the
ClusterLogForwarder
CR if you installed OpenShift Logging version 5Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
ClusterLogForwarder
CR in theopenshift-logging
namespace by entering the following command:oc apply -n openshift-logging ClusterLogForwarder.yaml
$ oc apply -n openshift-logging ClusterLogForwarder.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
TektonConfig
custom resource (CR) by using the following command:oc edit TektonConfig config
$ oc edit TektonConfig config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Make the following changes in the
result
spec:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.2.2. Configuring an external database server Copy linkLink copied to clipboard!
Tekton Results uses a PostgreSQL database to store data. By default, the installation includes an internal PostgreSQL instance. You can configure the installation to use an external PostgreSQL server that already exists in your deployment.
Procedure
Create a secret with the credentials for connecting to your PostgreSQL server by entering the following command:
oc create secret generic tekton-results-postgres \ --namespace=openshift-pipelines \ --from-literal=POSTGRES_USER=<user> \ --from-literal=POSTGRES_PASSWORD=<password>
$ oc create secret generic tekton-results-postgres \ --namespace=openshift-pipelines \ --from-literal=POSTGRES_USER=<user> \ --from-literal=POSTGRES_PASSWORD=<password>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
TektonConfig
custom resource (CR) by using the following command:oc edit TektonConfig config
$ oc edit TektonConfig config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Make the following changes in the
result
spec:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.2.3. Configuring the retention policy for Tekton Results Copy linkLink copied to clipboard!
By default, Tekton Results stores pipeline runs, task runs, events, and logs indefinitely. This leads to an unnecesary use of storage resources and can affect your database performance.
You can configure the retention policy for Tekton Results at the cluster level to remove older results and their associated records and logs.
Procedure
Edit the
TektonConfig
custom resource (CR) by using the following command:oc edit TektonConfig config
$ oc edit TektonConfig config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Make the following changes in the
result
spec:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.3. Querying Tekton Results for results and records Copy linkLink copied to clipboard!
You can use the opc
command line utility to query Tekton Results for results and records. To install the opc
command line utility, install the package for the tkn
command line utility. For instructions about installing this package, see Installing tkn.
You can use the names of records and results to retrieve the data in them.
You can search for results and records using Common Expression Language (CEL) queries. These searches display the UUIDs of the results or records. You can use the provided examples to create queries for common search types. You can also use reference information to create other queries.
1.3.1. Preparing the opc utility environment for querying Tekton Results Copy linkLink copied to clipboard!
Before you can query Tekton Results, you must prepare the environment for the opc
utility.
Prerequisites
-
You installed the
opc
utility. -
You logged on to the OpenShift Container Platform cluster by using the OpenShift CLI (
oc
).
Procedure
Set the
RESULTS_API
environment variable to the route to the Tekton Results API by entering the following command:export RESULTS_API=$(oc get route tekton-results-api-service -n openshift-pipelines --no-headers -o custom-columns=":spec.host"):443
$ export RESULTS_API=$(oc get route tekton-results-api-service -n openshift-pipelines --no-headers -o custom-columns=":spec.host"):443
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create an authentication token for the Tekton Results API by entering the following command:
oc create token <service_account>
$ oc create token <service_account>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<service_account>
with the name of an OpenShift Container Platform service account that has read access to the namespaces where OpenShift Pipelines ran the pipeline runs and task runs.Save the string that this command outputs.
Optional: Create the
~/.config/tkn/results.yaml
file for automatic authentication with the Tekton Results API. The file must have the following contents:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The route to the Tekton Results API. Use the same value as you set for
RESULTS_API
. - 2
- The authentication token that was created by the
oc create token
command. If you provide this token, it overrides theservice_account
setting andopc
uses this token to authenticate. - 3
- The location of the file with the SSL certificate that you configured for the API endpoint.
- 4
- If you configured a custom target namespace for OpenShift Pipelines, replace
openshift-pipelines
with the name of this namespace. - 5 6
- The name of a service account for authenticating with the Tekton Results API. If you provided the authentication token, you do not need to provide the
service_account
parameters.
Alternatively, if you do not create the
~/.config/tkn/results.yaml
file, you can pass the token to eachopc
command by using the--authtoken
option.
1.3.2. Querying for results and records by name Copy linkLink copied to clipboard!
You can list and query results and records using their names.
Prerequisites
-
You installed the
opc
utility and prepared its environment to query Tekton Results. -
You installed the
jq
package. - If you want to query logging information, you configured log forwarding to LokiStack.
Procedure
List the names of all results that correspond to pipeline runs and task runs created in a namespace. Enter the following command:
opc results result list --addr ${RESULTS_API} <namespace_name>
$ opc results result list --addr ${RESULTS_API} <namespace_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example command
opc results result list --addr ${RESULTS_API} results-testing
$ opc results result list --addr ${RESULTS_API} results-testing
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Name Start Update results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed 2023-06-29 02:49:53 +0530 IST 2023-06-29 02:50:05 +0530 IST results-testing/results/ad7eb937-90cc-4510-8380-defe51ad793f 2023-06-29 02:49:38 +0530 IST 2023-06-29 02:50:06 +0530 IST results-testing/results/d064ce6e-d851-4b4e-8db4-7605a23671e4 2023-06-29 02:49:45 +0530 IST 2023-06-29 02:49:56 +0530 IST
Name Start Update results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed 2023-06-29 02:49:53 +0530 IST 2023-06-29 02:50:05 +0530 IST results-testing/results/ad7eb937-90cc-4510-8380-defe51ad793f 2023-06-29 02:49:38 +0530 IST 2023-06-29 02:50:06 +0530 IST results-testing/results/d064ce6e-d851-4b4e-8db4-7605a23671e4 2023-06-29 02:49:45 +0530 IST 2023-06-29 02:49:56 +0530 IST
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the names of all records in a result by entering the following command:
opc results records list --addr ${RESULTS_API} <result_name>
$ opc results records list --addr ${RESULTS_API} <result_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example command
opc results records list --addr ${RESULTS_API} results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed
$ opc results records list --addr ${RESULTS_API} results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the YAML manifest for a pipeline run or task run from a record by entering the following command:
opc results records get --addr ${RESULTS_API} <record_name> \ | jq -r .data.value | base64 -d | \ xargs -0 python3 -c 'import sys, yaml, json; j=json.loads(sys.argv[1]); print(yaml.safe_dump(j))'
$ opc results records get --addr ${RESULTS_API} <record_name> \ | jq -r .data.value | base64 -d | \ xargs -0 python3 -c 'import sys, yaml, json; j=json.loads(sys.argv[1]); print(yaml.safe_dump(j))'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example command
opc results records get --addr ${RESULTS_API} \ results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/records/e9c736db-5665-441f-922f-7c1d65c9d621 | \ jq -r .data.value | base64 -d | \ xargs -0 python3 -c 'import sys, yaml, json; j=json.loads(sys.argv[1]); print(yaml.safe_dump(j))'
$ opc results records get --addr ${RESULTS_API} \ results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/records/e9c736db-5665-441f-922f-7c1d65c9d621 | \ jq -r .data.value | base64 -d | \ xargs -0 python3 -c 'import sys, yaml, json; j=json.loads(sys.argv[1]); print(yaml.safe_dump(j))'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Retrieve the logging information for a task run from a record using the log record name. To get the log record name, replace
records
withlogs
in the record name. Enter the following command:opc results logs get --addr ${RESULTS_API} <log_record_name> | jq -r .data | base64 -d
$ opc results logs get --addr ${RESULTS_API} <log_record_name> | jq -r .data | base64 -d
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example command
opc results logs get --addr ${RESULTS_API} \ results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/logs/e9c736db-5665-441f-922f-7c1d65c9d621 | \ jq -r .data | base64 -d
$ opc results logs get --addr ${RESULTS_API} \ results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/logs/e9c736db-5665-441f-922f-7c1d65c9d621 | \ jq -r .data | base64 -d
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.3.3. Searching for results Copy linkLink copied to clipboard!
You can search for results using Common Expression Language (CEL) queries. For example, you can find results for pipeline runs that did not succeed. However, most of the relevant information is not contained in result objects; to search by the names, completion times, and other data, search for records.
Prerequisites
-
You installed the
opc
utility and prepared its environment to query Tekton Results.
Procedure
Search for results using a CEL query by entering the following command:
opc results result list --addr ${RESULTS_API} --filter="<cel_query>" <namespace-name>
$ opc results result list --addr ${RESULTS_API} --filter="<cel_query>" <namespace-name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Replace <namespace_name>
with the namespace in which the pipeline runs or task runs were created.
Purpose | CEL query |
---|---|
The results of all runs that failed |
|
The results all pipeline runs that contained the annotations |
|
1.3.4. Searching for records Copy linkLink copied to clipboard!
You can search for records using Common Expression Language (CEL) queries. As each record contains full YAML information for a pipeline run or task run, you can find records by many different criteria.
Prerequisites
-
You installed the
opc
utility and prepared its environment to query Tekton Results.
Procedure
Search for records using a CEL query by entering the following command:
opc results records list --addr ${RESULTS_API} --filter="<cel_query>" <namespace_name>/result/-
$ opc results records list --addr ${RESULTS_API} --filter="<cel_query>" <namespace_name>/result/-
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<namespace_name>
with the namespace in which the pipeline runs or task runs were created. Alternatively, search for records within a single result by entering the following command:opc results records list --addr ${RESULTS_API} --filter="<cel_query>" <result_name>
$ opc results records list --addr ${RESULTS_API} --filter="<cel_query>" <result_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<result_name>
with the full name of the result.
Purpose | CEL query |
---|---|
Records of all task runs or pipeline runs that failed |
|
Records where the name of the |
|
Records for all task runs that were started by the |
|
Records of all pipeline runs and task runs that were created from a |
|
Records of all pipeline runs that were created from a |
|
Records of all task runs where the |
|
Records of all pipeline runs that took more than five minutes to complete |
|
Records of all pipeline runs and task runs that completed on October 7, 2023 |
|
Records of all pipeline runs that included three or more tasks |
|
Records of all pipeline runs that had annotations containing |
|
Records of all pipeline runs that had annotations containing |
|
1.3.5. Reference information for searching results Copy linkLink copied to clipboard!
You can use the following fields in Common Expression Language (CEL) queries for results:
CEL field | Description |
---|---|
|
The namespace in which the |
| Unique identifier for the result. |
|
Annotations added to the |
| The summary of the result. |
| The creation time of the result. |
| The last update time of the result. |
You can use the summary.status
field to determine whether the pipeline run was successful. This field can have the following values:
-
UNKNOWN
-
SUCCESS
-
FAILURE
-
TIMEOUT
-
CANCELLED
Do not use quote characters such as "
or '
to provide the value for this field.
1.3.6. Reference information for searching records Copy linkLink copied to clipboard!
You can use the following fields in Common Expression Language (CEL) queries for records:
CEL field | Description | Values |
---|---|---|
| Record name | |
| Record type identifier |
|
| The YAML data for the task run or pipeline run. In log records, this field contains the logging output. |
Because the data
field contains the entire YAML data for the task run or pipeline run, you can use all elements of this data in your CEL query. For example, data.status.completionTime
contains the completion time of the task run or pipeline run.
1.4. Querying results and logs by the names of pipeline runs and task runs Copy linkLink copied to clipboard!
You can use the opc
command line utility to query Tekton Results for lists of pipeline runs and tasks runs and then retrieve manifest and log information using the names of pipeline runs and tasks runs.
This approach requires different configuration of the opc
command line utility, compared to queries for results and records.
Querying results and logs by the names of pipeline runs and task runs is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
1.4.1. Configuring the opc utility for querying results by pipeline run and task run names Copy linkLink copied to clipboard!
Before you can query results from Tekton Results by pipeline run and task run names, you must configure the opc
utility.
Prerequisites
-
You installed the
opc
utility. -
You logged on to the OpenShift Container Platform cluster by using the OpenShift CLI (
oc
).
Procedure
Create an authentication token for the Tekton Results API by entering the following command:
oc create token <service_account>
$ oc create token <service_account>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<service_account>
with the name of an OpenShift Container Platform service account that has read access to the namespaces where OpenShift Pipelines ran the pipeline runs and task runs.Save the string that this command outputs.
Complete one of the following steps:
Configure the
opc
utility interactively by entering the following command:opc results config set
$ opc results config set
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Reply to the prompts that the utility displays. For
Token
, enter the authentication token that you created.Configure the
opc
utility from a command by entering the following command:opc results config set --host="https://tekton-results.example.com" --token="<token>"
$ opc results config set --host="https://tekton-results.example.com" --token="<token>"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the host name with the fully qualified domain name of your Tekton Results route. Replace
<token>
with the authentication token that you generated.
Verification
You can view the configuration that you set for the
opc
utility by entering the following command:opc results config view
$ opc results config view
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.4.2. Viewing a list of pipeline run names and identifiers Copy linkLink copied to clipboard!
You can use the opc
utility to view a list of names and identifiers of pipeline runs in a namespace.
Prerequisites
-
You installed the
opc
utility. -
You configured the
opc
utility to query results from Tekton Results by pipeline run and task run names.
Procedure
Use any of the following commands to view pipeline runs:
To view all pipeline runs in a specified namespace, enter the following command:
opc results pipelinerun list -n <namespace_name>
$ opc results pipelinerun list -n <namespace_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optionally, specify the
--limit
command line option, for example,--limit=10
. With this setting, theopc
command displays the specified number of lines containing pipeline run names and then exits. If you add the--single-page=false
command line option, the command displays the specified number of lines and then prompts you to continue or quit.Optionally, specify the
--labels
command line option, for example,--labels="app.kubernetes.io/name=test-app, app.kubernetes.io/component=database
. With this setting, the list includes only the pipeline runs that have the specified labels or annotations.Example output of the
opc results pipelinerun list
commandCopy to Clipboard Copied! Toggle word wrap Toggle overflow To view pipeline runs related to specified named pipelines, enter the following command:
opc results pipelinerun list <pipeline_name> -n <namespace_name>
$ opc results pipelinerun list <pipeline_name> -n <namespace_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The command lists all pipeline runs for pipelines that have names containing
<pipeline_name>
. For example, if you specifybuild
, the command displays all pipeline runs related to pipelines namedbuild
,build_123
, orenhancedbuild
.Optionally, specify the
--limit
command line option, for example,--limit=10
. With this setting, theopc
command displays the specified number of lines containing pipeline run names and then exits. If you add the--single-page=false
command line option, the command displays the specified number of lines and then prompts you to continue or quit.
1.4.3. Viewing a list of task run names and identifiers Copy linkLink copied to clipboard!
You can use the opc
utility to view a lists of names and identifiers of task runs in a namespace or of task runs associated with a pipeline dun.
Prerequisites
-
You installed the
opc
utility. -
You configured the
opc
utility to query results from Tekton Results by pipeline run and task run names.
Procedure
To view a list of all task runs in a namespace, enter the following command:
opc results taskrun list -n <namespace_name>
$ opc results taskrun list -n <namespace_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optionally, specify the
--limit
command line option, for example,--limit=10
. With this setting, theopc
command displays the specified number of lines containing pipeline run names and then exits. If you add the--single-page=false
command line option, the command displays the specified number of lines and then prompts you to continue or quit.Optionally, specify the
--labels
parameter, for example,--labels="app.kubernetes.io/name=test-app, app.kubernetes.io/component=database
. With this setting, the list includes only the task runs that have the specified labels or annotations.Example output of the
opc results pipelinerun list
command for a namespaceCopy to Clipboard Copied! Toggle word wrap Toggle overflow To view a list of task runs associate with a pipeline run, enter the following command:
opc results taskrun list --pipelinerun <pipelinerun_name> -n <namespace_name>
$ opc results taskrun list --pipelinerun <pipelinerun_name> -n <namespace_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optionally, specify the
--limit
command line option, for example,--limit=10
. With this setting, theopc
command displays the specified number of lines containing pipeline run names and then exits. If you add the--single-page=false
command line option, the command displays the specified number of lines and then prompts you to continue or quit.
Example output of the opc results taskrun list
command for a pipeline run
+
1.4.4. Viewing result information for a pipeline run Copy linkLink copied to clipboard!
You can use the opc
utility to view a description of when and how a pipeline run completed, a full manifest for the pipeline run, and any logs that the pipeline run produced.
Prerequisites
-
You installed the
opc
utility. -
You configured the
opc
utility to query results from Tekton Results by pipeline run and task run names. -
You have the name or UUID of the pipeline run. You can use the
ocp results list pipelineruns
commands to view names and UUIDs of pipeline runs for which results are available.
Procedure
Use any of the following commands to view the result information for a pipeline run:
To view a description of when and how the pipeline run completed, enter the following command:
opc results pipelinerun describe -n <namespace_name> <pipelinerun_name>
$ opc results pipelinerun describe -n <namespace_name> <pipelinerun_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use the pipeline run UUID instead of the name:
opc results pipelinerun describe -n <namespace_name> --uid <pipelinerun_uuid>
$ opc results pipelinerun describe -n <namespace_name> --uid <pipelinerun_uuid>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output of the
opc results pipelinerun describe
commandCopy to Clipboard Copied! Toggle word wrap Toggle overflow
To view the full YAML manifest of the pipeline run, enter the following command:
opc results pipelinerun describe -n <namespace_name> --output yaml <pipelinerun_name>
$ opc results pipelinerun describe -n <namespace_name> --output yaml <pipelinerun_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use the pipeline run UUID instead of the name:
opc results pipelinerun describe -n <namespace_name> --output yaml --uid <pipelinerun_uuid>
$ opc results pipelinerun describe -n <namespace_name> --output yaml --uid <pipelinerun_uuid>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To view the logs associated with the pipeline run, enter the following command:
opc results pipelinerun logs -n <namespace_name> <pipelinerun_name>
$ opc results pipelinerun logs -n <namespace_name> <pipelinerun_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use the pipeline run UUID instead of the name:
opc results pipelinerun logs -n <namespace_name> --uid <pipelinerun_uuid>
$ opc results pipelinerun logs -n <namespace_name> --uid <pipelinerun_uuid>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Logs that the opc results pipelinerun logs
displays do not include logs of task runs that completed within this pipeline run. To view these logs, find the names of the task runs in this pipeline run using the opc results taskrun list --pipelinerun
command and specify the name of the pipeline run. Then use the opc results taskrun log
command to view the logs for the task runs.
1.4.5. Viewing result information for a task run Copy linkLink copied to clipboard!
You can use the opc
utility to view a description of when and how a task run completed, a full manifest for the task run, and any logs that the task run produced.
Prerequisites
-
You installed the
opc
utility. -
You configured the
opc
utility to query results from Tekton Results by pipeline run and task run names. -
You have the name or UUID of the task run. You can use the
opc results taskrun list
command to view names or UUIDs of task runs for which results are available. - If you want to retrieve logs, you configured forwarding logs to LokiStack.
Procedure
Use any of the following commands to view the result information for a task run:
To view a description of when and how the task run completed, enter the following command:
opc results taskrun describe -n <namespace_name> <taskrun_name>
$ opc results taskrun describe -n <namespace_name> <taskrun_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use the task run UUID instead of the name:
opc results taskrun describe -n <namespace_name> --uid <taskrun_uuid>
$ opc results taskrun describe -n <namespace_name> --uid <taskrun_uuid>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output of the
opc results taskrun describe
commandCopy to Clipboard Copied! Toggle word wrap Toggle overflow
To view the full YAML manifest of the task run, enter the following command:
opc results taskrun describe -n <namespace_name> --output yaml <taskrun_name>
$ opc results taskrun describe -n <namespace_name> --output yaml <taskrun_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use the task run UUID instead of the name:
opc results taskrun describe -n <namespace_name> --output yaml --uid <taskrun_uuid>
$ opc results taskrun describe -n <namespace_name> --output yaml --uid <taskrun_uuid>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To view the logs associated with the task run, enter the following command:
opc results taskrun logs -n <namespace_name> <taskrun_name>
$ opc results taskrun logs -n <namespace_name> <taskrun_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can use the task run UUID instead of the name:
opc results taskrun logs -n <namespace_name> --uid <taskrun_uuid>
$ opc results taskrun logs -n <namespace_name> --uid <taskrun_uuid>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.4.6. Short names for command-line arguments Copy linkLink copied to clipboard!
When using the opc
utility to query results from Tekton Results by pipeline run and task run names, you can replace long command-line arguments with short versions of their names.
Full parameter name | Short parameter name |
---|---|
|
|
|
|
|
|