Resource Groups
Apply different pruning policies to different sets of PipelineRuns/TaskRuns using selectors.
IMPORTANT: Selectors only work in namespace-level ConfigMaps (tekton-pruner-namespace-spec). Selectors in global ConfigMaps are ignored by the pruner.
WARNING
Namespace-level ConfigMaps are outside the TektonConfig lifecycle. If you need to back up or restore Tekton configuration later, save these ConfigMaps separately.
TOC
How It WorksSelector TypesCommon PatternsOrder MattersBest PracticesAdvanced ConfigurationsMulti-tier ApplicationRelease TypesLabeling Your PipelinesRelatedHow It Works
- Match by labels or annotations on PipelineRuns/TaskRuns
- First match wins: Groups evaluated in order
- Fallback: Unmatched resources use namespace or global defaults
- Location: Must be in namespace ConfigMap, not global ConfigMap
Selector Types
Label selectors:
Annotation selectors:
Mixed selectors (both labels and annotations must match):
Common Patterns
By Pipeline Type:
By Environment:
By Criticality:
Order Matters
First match wins - order selectors from most to least specific:
Best Practices
- Use namespace ConfigMaps for selector-based groups
- Order selectors from most to least specific (first match wins)
- Use consistent labels:
app,component,env,tier - Document groups with comments above selectors
- Test with sample runs before production
Advanced Configurations
Multi-tier Application
Release Types
Labeling Your Pipelines
Add labels to PipelineRuns for grouping:
Related
- Namespace Configuration - Set up namespace ConfigMaps
- Time-based Pruning - TTL strategies for groups
- History-based Pruning - Retention strategies for groups