Skip to main content
High Availability (HA) support allows Tekton Pipelines components to remain operational when disruptions occur, such as nodes being drained for upgrades or instance failures.

Overview

Tekton Pipelines provides HA support for two main components:
  • Controller - Uses active/active model with distributed workqueue across buckets
  • Webhook - Stateless deployment that can be easily scaled and auto-scaled
By default, both components run with a single replica to reduce resource usage, effectively disabling HA.

Controller High Availability

The Controller achieves HA through an active/active model where all replicas can receive and process work items. The workqueue is distributed across buckets, with each replica owning a subset of those buckets.

Configuring Controller Replicas

To enable HA for the Controller, increase the replica count to more than one:
Or modify the controller deployment directly in config/controller.yaml:

Leader Election Configuration

Leader election is configured in the config-leader-election-controller ConfigMap:
string
default:"1"
Number of buckets used to partition the key space of each Reconciler. If this number is M and the replica count is N, the N replicas compete for M buckets.
Maximum value is 10.
duration
default:"60s"
How long non-leaders wait before trying to acquire the lock. Core Kubernetes controllers use 15s.
duration
default:"40s"
How long a leader will try to renew the lease before giving up. Core Kubernetes controllers use 10s.
duration
default:"10s"
How long the leader election client waits between action attempts. Core Kubernetes controllers use 2s.

How Leader Election Works

  1. The workqueue is divided into buckets based on the buckets configuration
  2. Each controller replica competes to become the leader of specific buckets
  3. The replica that owns a bucket processes all work items partitioned into that bucket
  4. If a replica fails, other replicas can take over its buckets

Disabling Controller HA

To disable HA, scale back to one replica:
Alternatively, set the disable-ha flag in the controller deployment:
If you set -disable-ha=false and run multiple replicas, each replica will process work items separately, leading to unwanted behavior when creating resources. It’s recommended to simply run one replica instead of using the flag.

Webhook High Availability

The Webhook deployment is stateless, making it easier to configure for HA and enabling autoscaling based on load.

Configuring Webhook Replicas

Increase the number of webhook replicas:
Or modify the webhook deployment in config/webhook.yaml:

Horizontal Pod Autoscaling

Tekton Pipelines includes a HorizontalPodAutoscaler for the webhook:
To increase the minimum number of replicas:
The webhook requires a Metrics Server in your cluster for the HorizontalPodAutoscaler to function properly.

Avoiding Disruptions

To ensure minimum webhook availability during node disruptions, define a PodDisruptionBudget:
This ensures at least one webhook replica remains available during voluntary disruptions like node drains.

Pod Anti-Affinity

Webhook replicas are configured with pod anti-affinity by default to avoid scheduling all replicas on the same node:
This ensures that a single node failure doesn’t make all webhook replicas unavailable.

Cluster Autoscaler Considerations

By default, the webhook deployment is not configured to block the Cluster Autoscaler from scaling down nodes. During node drains, the webhook might become temporarily unavailable. To prevent this, either:
  1. Add the safe-to-evict annotation:
  1. Configure multiple webhook replicas (recommended approach)

Prerequisites for HA

Metrics Server

High concurrency scenarios and webhook autoscaling require a Metrics Server:
Verify the Metrics Server is running:

Complete HA Configuration Example

Verification

Verify your HA configuration:

Best Practices

  1. Start with 3 replicas for both controller and webhook in production environments
  2. Configure PodDisruptionBudgets to maintain availability during cluster maintenance
  3. Use HPA for webhooks to handle variable load automatically
  4. Monitor metrics to tune replica counts and resource requests/limits
  5. Increase bucket count to 10 when running many controller replicas for better load distribution
  6. Test failover by draining nodes or deleting pods to verify HA behavior
  7. Set appropriate resource requests/limits to ensure pods can be scheduled across multiple nodes