History-based Pruning
Retain a fixed number of runs based on their status, regardless of age.
TOC
How 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:
WARNING
Namespace-level ConfigMaps are outside the TektonConfig lifecycle. If you need to back up or restore Tekton configuration later, save these ConfigMaps separately.
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