Skip to content

crc-org/concurrency-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tekton PipelineRun Concurrency Controller

A lightweight controller that manages concurrent execution of Tekton PipelineRuns on OpenShift, ensuring that pipeline runs sharing the same builder or tester machines do not execute simultaneously.

How it works

  1. PipelineRuns are submitted in a pending state (spec.status: PipelineRunPending).
  2. The controller polls the cluster on a configurable interval (default 30s) using the oc CLI.
  3. On each reconcile cycle it identifies busy machines by reading the builder and tester labels from currently running PipelineRuns.
  4. Pending PipelineRuns whose required machines are all free are started by patching away the spec.status field.
  5. PipelineRuns with no machine labels are started immediately.

This prevents two pipelines from using the same physical/virtual machine at the same time.

Configuration

Environment variable Default Description
POLL_INTERVAL 30 Seconds between reconcile cycles
NAMESPACE (current namespace) OpenShift namespace to watch
PORT 8080 HTTP port for health/status endpoints

HTTP endpoints

Endpoint Description
GET /healthz Returns {"status": "ok"} — for liveness/readiness probes
GET /status Returns current controller state (busy machines, pending/running PipelineRuns, last reconcile timestamp)

Building and running

Requires Podman.

# Build the container image
make build

# Build and push to quay.io
make push

The container expects an authenticated oc session to be available at runtime.

Prerequisites

  • OpenShift cluster with Tekton installed
  • PipelineRuns must use the builder and/or tester labels to declare which machines they need
  • PipelineRuns must be created with spec.status: PipelineRunPending to be managed by the controller

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages