Time-based Pruning (TTL)
Delete completed resources after a specified duration using ttlSecondsAfterFinished.
TOC
How It Works
TTL applies to all completed runs (successful and failed). The timer starts when the run finishes.
Basic Configuration
Common TTL Values
Environment-specific TTLs
Pipeline-specific TTLs
Use selectors in namespace ConfigMaps for pipeline-specific TTLs:
WARNING
Namespace-level ConfigMaps are outside the TektonConfig lifecycle. If you need to back up or restore Tekton configuration later, save these ConfigMaps separately.
Combining TTL with History Limits
History limits override TTL to guarantee minimum retention:
Result: Runs are deleted after 5 minutes UNLESS they're in the last 5 successful or last 10 failed.
Best Practices
- Development: Short TTLs (5-60 min) for rapid iteration
- Production: Long TTLs (7-30 days) for audit/compliance
- Critical Pipelines: Use selectors for extended retention
- Balance: Consider storage costs vs. retention needs
Related
- History-based Pruning - Retain N runs regardless of age
- Namespace Configuration - Per-environment TTL settings
- Resource Groups - Pipeline-specific TTLs via selectors