Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 2. Understanding the Tekton Results retention policy
The Tekton Results Retention Policy Agent manages how long Tekton Results and Records are retained in the database before they are pruned. You can configure the retention behavior by using the tekton-results-config-results-retention-policy config map in the tekton-pipelines namespace.
The retention policy determines when and how old Tekton Results and Records are automatically deleted from the database. You can define global defaults as well as fine-grained rules based on namespaces, labels, annotations, or run statuses.
Use the following sample YAML configuration to define Tekton Results settings, including log retention policies, namespaces, and runtime options:
The following fields in the config map define the retention configuration:
| Field | Description | Default |
|---|---|---|
|
| Specifies when the pruning job runs. The value must use a cron schedule format. |
|
|
|
Specifies the fallback retention period for Results and Records when no specific policy matches. The value can be a number (in days) or a duration string such as |
|
|
|
(Deprecated). Used for backward compatibility if | N/A |
|
|
Defines a list of fine-grained retention policies for more specific control, in order of precedence. Each policy includes a name, selector, and retention period. For Records and Results matched by a policy’s selector, the policy’s retention period overrides the | None |
2.1. Fine-grained retention policies Link kopierenLink in die Zwischenablage kopiert!
You can use the policies field to define rules that apply to specific Results. The policies are evaluated in order, and the first policy that matches is applied. If no policies match, the defaultRetention value is used.
Each policy includes the following fields:
| Field | Description |
|---|---|
|
| A descriptive name for the policy. |
|
| Defines criteria for matching Results. All selector types use AND logic, meaning a Result must satisfy all specified conditions to match. You can omit a selector type to match all Results for that criterion. |
|
| A list of namespaces. The policy matches Results in any of the listed namespaces. |
|
| A map of label keys and possible values. A Result must have all listed label keys, and each value must match one of the values in the list. |
|
|
A map of annotation keys and possible values. Works similarly to |
|
|
A list of final statuses such as |
|
|
The retention period for matching Results. The value can be a number (days) or a duration string such as |
The following example shows a config map that defines multiple retention policies:
The following examples describe how the defined retention policies are applied to different Results based on their namespaces, labels, annotations, and statuses.
-
A failed Result in the
productionorprod-eastnamespace with the labelcriticality: highis retained for 180 days. -
Any Result with the annotation
debug/retain: "true"is retained for 14 days. -
Results in the
productionorprod-eastnamespaces are retained for 60 days. -
Results in the
cinamespace are retained for 7 days. - All other Results that do not match any policy are retained for the default 30 days.