History-based Pruning
Retain a fixed number of runs based on their status, regardless of age.
TOC
How It WorksConfiguration OptionsBasic ConfigurationEnvironment-specific LimitsPipeline-specific LimitsInteraction with TTLBest PracticesRelatedHow It Works
History limits and TTL can both apply. A run is eligible for deletion if it exceeds history limits or its TTL has expired. This means the shortest retention wins.
Configuration Options
Basic Configuration
Separate limits by status:
Same limit for both:
Environment-specific Limits
Pipeline-specific Limits
Use selectors in namespace ConfigMaps for pipeline-specific limits:
Namespace-level ConfigMaps are outside the TektonConfig lifecycle. If you need to back up or restore Tekton configuration later, save these ConfigMaps separately.
For each field, the sum of the selector limits cannot exceed the namespace-level value of the same field in this ConfigMap. If that field is not set, the bound falls back to the namespace-level historyLimit, then to the global configuration, then to the system maximum of 100. The namespace-level values themselves cannot exceed the global limits.
Interaction with TTL
History limits do not override TTL:
Result: Runs older than 5 minutes are deleted even if they are within the last 5 successful or last 10 failed. History limits can still delete older runs sooner if more than the configured counts exist.
Best Practices
- Keep more failed runs than successful for debugging
- Critical pipelines: Higher limits for audit trails
- Development: Lower limits (3-5) for rapid iteration
- Production: Higher limits (10-20) for analysis
- Monitor storage: Adjust limits based on cluster capacity
Related
- Time-based Pruning - Age-based deletion
- Namespace Configuration - Per-environment limits
- Resource Groups - Pipeline-specific limits