This project aims to address TEP-0120: Canceling Concurrent PipelineRuns. It is an experimental project that may change in breaking ways at any time.
kubectl apply --filename https://storage.googleapis.com/tekton-releases-nightly/concurrency/latest/release.yaml
ko apply -f config
To try it out:
kubectl apply -f examples/concurrencycontrol.yaml
kubectl create -f examples/pipelinerun.yaml
This first PipelineRun should begin executing normally. Now, create another PipelineRun that also matches the concurrency control:
kubectl create -f examples/pipelinerun.yaml
The first PipelineRun should be canceled, and the second one should execute normally.
Supported strategies are "Cancel", "GracefullyCancel", and "GracefullyStop" (corresponding to canceling, gracefully canceling, and gracefully stopping a PipelineRun, respectively). The default strategy is "GracefullyCancel". If multiple ConcurrencyControls with different strategies apply to the same PipelineRun, concurrency controls will fail.
To restrict the concurrency webhook and controller to only modify PipelineRuns in a subset of namespaces,
edit the "allowed-namespaces" field of the concurrency configMap to be
a comma-separated list of these namespaces, for example: allowed-namespaces: "default,another-namespace"
.