tekton-pipeline-queue

by sergk

Helm chartv0.1.0-SNAPSHOT.14App 0.1.0-SNAPSHOT.14Apache-2.0Verified publisher

A Helm chart for the Tekton Pipeline Queue operator

About this chart

tekton-pipeline-queue

A Helm chart for the Tekton Pipeline Queue operator

Homepage: https://docs.kuberocketci.io/

Introduction

Tekton Pipeline Queue governs concurrency and admission ordering of Tekton PipelineRun resources. It defines the PipelineRunQueue CRD, which selects a set of PipelineRuns (via a label selector), groups them into lanes (via label-derived queue keys) and admits at most concurrency runs per lane according to a configurable strategy, keeping the rest queued until a slot becomes free.

Project Structure

  • api/v1alpha1/: Contains the API definitions for the PipelineRunQueue custom resource, including the structure and validation of the CRD.
  • cmd/: Hosts the main application entry point and the command-line interface setup.
  • config/: Includes Kubernetes configuration files for deploying the controller, such as CRDs, RBAC rules, and sample configurations.
  • docs/: Provides detailed documentation on the API and usage examples.
  • deploy-templates/: Contains Helm chart templates for deploying the controller.

Getting Started

To get started with Tekton Pipeline Queue, ensure you have Kubernetes and Tekton Pipelines installed in your environment. Follow these steps to deploy the controller:

  1. Clone the repository to your local environment.

  2. Navigate to the config/ directory.

  3. Apply the CRDs to your Kubernetes cluster:

    kubectl apply -f config/crd/bases/
    

Deploy with Helm

  1. To add the Helm EPAMEDP Charts for local client, run "helm repo add":

    helm repo add epamedp https://epam.github.io/edp-helm-charts/stable
    
  2. Choose available Helm chart version:

    helm search repo epamedp/tekton-pipeline-queue -l
    NAME                              CHART VERSION   APP VERSION     DESCRIPTION
    epamedp/tekton-pipeline-queue      0.1.0          0.1.0          A Helm chart for the Tekton Pipeline Queue operator
    

    NOTE: It is highly recommended to use the latest released version.

  3. Full chart parameters available in deploy-templates/README.md.

  4. Install operator with the following command:

    helm install tekton-pipeline-queue epamedp/tekton-pipeline-queue --version <chart_version>
    
  5. Check the namespace that should contain the Tekton Pipeline Queue controller in a running status.

Deploy with cluster add-ons

  1. Navigate to the forked edp-cluster-add-ons repository.

  2. Enable the deployment of the Tekton Pipeline Queue Helm chart by setting the tekton-pipeline-queue.enable and tekton-pipeline-queue.createNamespace values to true in the clusters/core/apps/values.yaml file.

    tekton-pipeline-queue:
      createNamespace: true
      enable: true
    
  3. Update the clusters/core/addons/tekton-pipeline-queue/values.yaml file with the desired configuration for the Tekton Pipeline Queue Helm chart.

  4. After updating the values.yaml file, commit the changes to the repository and apply the changes with Helm or Argo CD.

Usage

Create a PipelineRunQueue that selects the PipelineRuns to govern and defines how they are grouped into lanes:

apiVersion: edp.epam.com/v1alpha1
kind: PipelineRunQueue
metadata:
  name: deploy-queue
spec:
  selector:
    matchLabels:
      app.edp.epam.com/pipelinetype: deploy
  queueKey:
    - app.edp.epam.com/cdpipeline
    - app.edp.epam.com/cdstage
  concurrency: 1
  strategy: Queue

Apply the definition to your Kubernetes cluster:

kubectl apply -f pipelinerunqueue.yaml

Features

  • Lane-based Concurrency Control: Group PipelineRuns into independent lanes via label-derived queue keys and cap the number of concurrently running runs per lane.
  • Configurable Admission Strategy: Choose whether newer runs queue behind, replace queued, or cancel in-progress runs in the same lane.
  • Flexible Selection: Use a standard Kubernetes label selector to choose which PipelineRuns a queue governs.

Contributing

We welcome contributions in the form of issues and pull requests. Please follow the contributing guidelines outlined in the repository.

License

This project is licensed under the Apache License 2.0.

Maintainers

NameEmailUrl
epmd-edp[email protected]https://solutionshub.epam.com/solution/kuberocketci

Source Code

Values

KeyTypeDefaultDescription
affinityobject{}Affinity for pod assignment
annotationsobject{}Annotations to add to the deployment
extraVolumeMountslist[]Additional volume mounts to add to the manager container
extraVolumeslist[]Additional volumes to add to the manager pod
image.registrystring""tekton-pipeline-queue image registry. Leave empty to use the repository as-is (Docker Hub by default)
image.repositorystring"epamedp/tekton-pipeline-queue"tekton-pipeline-queue Docker image name. The released image can be found on Dockerhub
image.tagstringniltekton-pipeline-queue Docker image tag. The released image can be found on Dockerhub. If not defined then .Chart.AppVersion is used
imagePullPolicystring"IfNotPresent"Image pull policy
imagePullSecretslist[]Optional array of imagePullSecrets containing private registry credentials # Ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry
namestring"tekton-pipeline-queue"component name
nodeSelectorobject{}Node labels for pod assignment
podSecurityContextobject{"runAsNonRoot":true,"seccompProfile":{"type":"RuntimeDefault"}}Pod-level security context # Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
resourcesobject{"limits":{"memory":"192Mi"},"requests":{"cpu":"50m","memory":"64Mi"}}Resource requests/limits for the manager container. # Ref: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true}Container-level security context # Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
tolerationslist[]Tolerations for pod assignment

Deploy tekton-pipeline-queue with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has tekton-pipeline-queue on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charttekton-pipeline-queue is pinned at v0.1.0-SNAPSHOT.14 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply