Skip to content

Commit 0cc2135

Browse files
author
edge-katanomi-app2[bot]
committed
📚 Sync docs from alaudadevops/tektoncd-operator on 6a52ba9076729c8028c8284f7f02be7e74521124
Source: docs: [DEVOPS-42384] add how-to docs for output markdown to the overview tab (#654) Author: yzc Ref: refs/heads/main Commit: 6a52ba9076729c8028c8284f7f02be7e74521124 This commit automatically syncs documentation changes from the source-docs repository. 🔗 View source commit: https://github.com/alaudadevops/tektoncd-operator/commit/6a52ba9076729c8028c8284f7f02be7e74521124 🤖 Synced on 2025-10-16 01:36:24 UTC
1 parent 6e9b8bd commit 0cc2135

File tree

3 files changed

+257
-3
lines changed

3 files changed

+257
-3
lines changed

.github/SYNC_INFO.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Documentation Sync Information
22

3-
- **Last synced**: 2025-10-15 09:57:30 UTC
3+
- **Last synced**: 2025-10-16 01:36:24 UTC
44
- **Source repository**: alaudadevops/tektoncd-operator
5-
- **Source commit**: [d8fd3e3edacc2e77fb8df195aa6130e0620eab8a](https://github.com/alaudadevops/tektoncd-operator/commit/d8fd3e3edacc2e77fb8df195aa6130e0620eab8a)
5+
- **Source commit**: [6a52ba9076729c8028c8284f7f02be7e74521124](https://github.com/alaudadevops/tektoncd-operator/commit/6a52ba9076729c8028c8284f7f02be7e74521124)
66
- **Triggered by**: edge-katanomi-app2[bot]
7-
- **Workflow run**: [#85](https://github.com/alaudadevops/tektoncd-operator/actions/runs/18525047159)
7+
- **Workflow run**: [#86](https://github.com/alaudadevops/tektoncd-operator/actions/runs/18547555465)
88

99
## Files synced:
1010
- docs/
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
---
2+
weight: 10
3+
i18n:
4+
title:
5+
en: Output Markdown to the Overview Tab (PipelineRuns & TaskRuns)
6+
zh: 输出 Markdown 到 Overview 标签(PipelineRuns & TaskRuns)
7+
title: Output Markdown to the Overview Tab (PipelineRuns & TaskRuns)
8+
---
9+
10+
# Output Markdown to the Overview Tab (PipelineRuns & TaskRuns)
11+
12+
This guide shows you how to surface human‑readable reports in the **Overview** tab of both **PipelineRuns** and **TaskRuns** by writing Markdown into a Task **Result** named `overview-markdown`.
13+
14+
## Prerequisites
15+
16+
- **Tekton Pipelines** installed on your cluster.
17+
- **Optional but recommended:** **Tekton Results** deployed so your summaries remain queryable even after old TaskRuns/PipelineRuns are garbage‑collected.
18+
19+
> Why Tekton Results? If your cluster prunes runs aggressively, the in‑cluster TaskRun/PipelineRun objects (and their results) may disappear. Tekton Results provides a central store so historical Overview reports remain accessible.
20+
21+
## How it works
22+
23+
- The UI reads a Task's **result** with the **exact name** `overview-markdown`.
24+
- Whatever Markdown you write into that result file will be rendered in the run's **Overview** tab.
25+
- In a Pipeline, **each Task** can produce its own `overview-markdown`, and the Overview tab shows them grouped by Task.
26+
- You **do not** need to write to a **Pipeline** result for the Overview tab; write to the **Task's** `overview-markdown` instead.
27+
28+
> **Limits:** A single Task's result value is limited to **4 KB** by default. Keep summaries concise; link out to larger artifacts when needed. If you want to configure the result size limit, you can refer to [Result Limit Exceeded When Writing Tekton Task Results](../trouble_shooting/result-limit-exceeded.mdx).
29+
30+
## Steps
31+
32+
### 1. Define a Task result named `overview-markdown`
33+
34+
Create (or update) your Task so it declares a string result with that exact name.
35+
36+
In one of the Task's steps, write Markdown to `$(results.overview-markdown.path)`.
37+
38+
Example Task (replace `<image>` as needed):
39+
40+
```yaml
41+
apiVersion: tekton.dev/v1
42+
kind: Task
43+
metadata:
44+
name: demo-markdown-overview
45+
spec:
46+
results:
47+
- name: overview-markdown
48+
description: "Markdown content displayed in the Overview tab."
49+
type: string
50+
steps:
51+
- name: write-markdown
52+
image: <image>
53+
script: |
54+
#!/bin/bash
55+
# Write Markdown to the result path.
56+
cat >"$(results.overview-markdown.path)" <<'EOF'
57+
# Demo Overview
58+
59+
**Status:** ✅ Success
60+
61+
**Artifacts**
62+
- Image: `ghcr.io/example/app:v1.2.3`
63+
- SBOM: `sbom.spdx.json`
64+
65+
**Notes**
66+
- Lint passed.
67+
- 0 critical vulnerabilities found.
68+
69+
_Generated by **demo-markdown-overview**._
70+
EOF
71+
```
72+
73+
Keep the Markdown short and focused. A single Task's result value is limited to **4 KB** by default. For long reports:
74+
75+
- Upload the full artifact (e.g., HTML, JSON, PDF) to your storage or artifact repository.
76+
- Put a link in the Markdown (e.g., `[Full report](https://artifact.example.com/run/123/report.html)`).
77+
78+
If you want to configure the result size limit, you can refer to [Result Limit Exceeded When Writing Tekton Task Results](../trouble_shooting/result-limit-exceeded.mdx).
79+
80+
### 2. Run the Task
81+
82+
Create a TaskRun referencing your Task, wait for it to complete.
83+
84+
Example TaskRun:
85+
86+
```yaml
87+
apiVersion: tekton.dev/v1
88+
kind: TaskRun
89+
metadata:
90+
name: demo-markdown-overview-run
91+
spec:
92+
taskRef:
93+
name: demo-markdown-overview
94+
```
95+
96+
### 3. View the overview
97+
98+
After TaskRun completes, open the TaskRun's **Overview** tab to see the rendered Markdown.
99+
100+
If nothing renders, check the step logs to confirm the file was written to `$(results.overview-markdown.path)` and that the result name is correct.
101+
102+
### 4. (Optional) Use it in Pipelines
103+
104+
In a Pipeline, each Task can output its **own** `overview-markdown`. The Overview tab will display separate sections per Task (e.g., `lint`, `scan`, `build`).
105+
106+
You **do not** need to the **Pipeline**'s results for this feature. Only **Task** results are rendered in the Overview tab.
107+
108+
Example Pipeline (replace `<lint-image>` `<scan-image>` as needed):
109+
110+
```yaml
111+
apiVersion: tekton.dev/v1
112+
kind: Pipeline
113+
metadata:
114+
name: pipeline-with-summaries
115+
spec:
116+
tasks:
117+
- name: lint
118+
taskSpec:
119+
results:
120+
- name: overview-markdown
121+
description: "Lint overview"
122+
type: string
123+
steps:
124+
- name: run-lint
125+
image: <lint-image>
126+
script: |
127+
#!/bin/bash
128+
cat >"$(results.overview-markdown.path)" <<'EOF'
129+
## Lint Overview
130+
131+
- Files checked: **128**
132+
- Issues: **0**
133+
- Tool: `golangci-lint 1.57.2`
134+
EOF
135+
136+
- name: scan
137+
runAfter: [lint]
138+
taskSpec:
139+
results:
140+
- name: overview-markdown
141+
description: "Security scan overview"
142+
type: string
143+
steps:
144+
- name: run-scan
145+
image: <scan-image>
146+
script: |
147+
#!/bin/bash
148+
cat >"$(results.overview-markdown.path)" <<'EOF'
149+
## Security Scan
150+
151+
**Findings**
152+
- Critical: **0**
153+
- High: **1** (CVE-2025-XXXX)
154+
- Medium: **3**
155+
EOF
156+
```
157+
158+
Example PipelineRun:
159+
160+
```yaml
161+
apiVersion: tekton.dev/v1
162+
kind: PipelineRun
163+
metadata:
164+
name: pipeline-with-summaries-run
165+
spec:
166+
pipelineRef:
167+
name: pipeline-with-summaries
168+
```
169+
170+
Open the PipelineRun's **Overview** tab. You should see two Markdown sections: **lint** and **scan**.
171+
172+
## Tips
173+
174+
- **Exact name matters:** The result must be named `overview-markdown` (case‑sensitive).
175+
- **Write to the right place:** Always write to `$(results.overview-markdown.path)`. You don't need a Pipeline‑level result.
176+
- **Size limit:** A single Task result value is capped at **4 KB** by default. If you want to configure the result size limit, you can refer to [Result Limit Exceeded When Writing Tekton Task Results](../trouble_shooting/result-limit-exceeded.mdx).
177+
178+
## Troubleshooting
179+
180+
- **Nothing shows in the Overview tab**
181+
- Check the result name: it must be exactly `overview-markdown`.
182+
- Verify the step wrote to `$(results.overview-markdown.path)`.
183+
- Confirm your UI version supports this feature.
184+
- **Pod logs show termination message overflow**
185+
- Refer to [Result Limit Exceeded When Writing Tekton Task Results](../trouble_shooting/result-limit-exceeded.mdx).
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
weight: 10
3+
i18n:
4+
title:
5+
en: Result Limit Exceeded When Writing Tekton Task Results
6+
zh: Tekton 任务结果写入限制
7+
title: Result Limit Exceeded When Writing Tekton Task Results
8+
---
9+
10+
# Result Limit Exceeded When Writing Tekton Task Results
11+
12+
## Problem Description
13+
14+
When a Task step writes relatively large content into a **Task result**, the output may fail due to size limits.
15+
16+
### Error Manifestation
17+
18+
- **Pod logs show termination message overflow** (result too large for default 4 KB cap):
19+
20+
```text
21+
2025/10/15 03:22:24 ERROR Error while substituting step artifacts: error="Termination message is above max allowed size 4096, caused by large task result."
22+
2025/10/15 03:22:24 Termination message is above max allowed size 4096, caused by large task result.
23+
```
24+
25+
## Root Cause Analysis
26+
27+
By default, Tekton Pipelines captures Task results through the container **termination message**, which Kubernetes limits to **4 KB**.
28+
This effectively caps a single Task's usable result size to **4096 bytes**.
29+
30+
To lift that ceiling, Tekton supports reading results from **sidecar logs**, where a configurable `max-result-size` is applied **per result**.
31+
32+
## Troubleshooting
33+
34+
Following are the steps to configure the result size limit:
35+
36+
1. Edit the TektonConfig resource by setting `spec.pipeline.results-from` and `spec.pipeline.max-result-size` as shown below:
37+
38+
```yaml
39+
apiVersion: operator.tekton.dev/v1alpha1
40+
kind: TektonConfig
41+
metadata:
42+
name: config
43+
spec:
44+
pipeline:
45+
# Use sidecar logs instead of termination messages
46+
results-from: sidecar-logs
47+
# Result size in bytes (example: 64 KiB). Max is 1,572,863 bytes.
48+
max-result-size: 65536
49+
```
50+
51+
2. The `feature-flags` ConfigMap will be updated automatically.
52+
53+
```yaml
54+
apiVersion: v1
55+
kind: ConfigMap
56+
metadata:
57+
name: feature-flags
58+
namespace: tekton-pipelines
59+
data:
60+
results-from: sidecar-logs
61+
max-result-size: "65536"
62+
```
63+
64+
3. No manual component restarts are required, changes will take effect automatically.
65+
66+
## Related Content
67+
68+
- [TektonPipeline](https://tekton.dev/docs/operator/tektonpipeline/)
69+
- [TektonConfig](https://tekton.dev/docs/operator/tektonconfig/)

0 commit comments

Comments
 (0)