Event based pruning of Tekton resources
Tekton Pruner is a controller that continuously monitors a predefined configuration in a ConfigMap and removes PipelineRuns and TaskRuns according to the specified settings.
By default, the Pruner controller watches the ConfigMap tekton-pruner-default-spec. Additionally, it includes two other controllers that monitor every PipelineRun and TaskRun event in the cluster, continuously reconciling to remove them based on the ConfigMap settings.
Current Features:
-
Ability to set a cluster-wide pruning configuration that applies to all namespaces in the cluster.
Pruning Configuration Variations (Prioritized from Highest to Lowest):
- Pruning PipelineRuns and TaskRuns based on TTL (time-to-live) in seconds.
ttlSecondsAfterFinished
- Defining the number of successful PipelineRuns/TaskRuns to retain.
successfulHistoryLimit
- Defining the number of failed PipelineRuns/TaskRuns to retain.
failedHistoryLimit
- Setting a fixed number of PipelineRuns/TaskRuns to retain, regardless of status.
historyLimit
sample configMap depiciting the above settings that apply to all namespaces in the cluster
apiVersion: v1 kind: ConfigMap metadata: name: tekton-pruner-default-spec namespace: tekton-pipelines data: global-config: | ttlSecondsAfterFinished: 600 # 5 minutes successfulHistoryLimit: 3 failedHistoryLimit: 3 historyLimit: 5
- Pruning PipelineRuns and TaskRuns based on TTL (time-to-live) in seconds.
Work In Progress Features:
-
Ability to set pruning configuration specific to a Namespace that can overrides the cluster-wide settings
-
Ability to set pruning configuration specific to PipelineRuns/TaskRuns that can be identified either by
- Parent Pipleline/Task Name
- Matching Labels
- Matching Annotations This configurations override the Namespace specific configuration
Prerequisite: you'll need Tekton Pipelines installed on your cluster before you install Pruner.
To install the latest version of Pruner to your Kubernetes cluster, run:
kubectl apply --filename ??release.yaml
To install a specific version of Chains, run:
kubectl apply -f ??release.yaml
To verify that installation was successful, wait until all Pods have Status
Running
:
kubectl get po -n tekton-pipelines --watch
NAME READY STATUS RESTARTS AGE
tekton-pruner-controller-5756bc7cb9-lblnx 1/1 Running 0 10s
To view and edit the default configuartions:
To get started with pruner, try out our getting started tutorial.
We are so excited to have you!
- See CONTRIBUTING.md for an overview of our processes
- See DEVELOPMENT.md for how to get started
- See ROADMAP.md for the current roadmap Check out our good first issues and our help wanted issues to get started!
- See releases.md for our release cadence and processes