Architecture
Architecture Overview
Tekton Pipelines is a Kubernetes-based CI/CD system that provides a set of standard Custom Resource Definitions (CRDs) to define and run CI/CD workflows as a series of steps. It's designed to be cloud-native, scalable, and extensible.

Core Components
1. Task
A Task is the basic building block of Tekton Pipelines:
- Defines a series of steps to execute
- Runs in a Kubernetes Pod
- Can accept inputs and produce outputs
- Executes steps in sequence
Main characteristics:
- Each step runs in its own container
- Steps share workspace volumes
- Supports parameterization
- Can define resource requirements
2. TaskRun
TaskRun is a runtime instance of a Task:
- Creates a Pod to execute the Task
- Manages the lifecycle of the Task execution
- Collects and stores execution results
- Handles resource allocation
Workflow:
- Creates a Pod with containers for each step
- Executes steps in sequence
- Manages shared volumes between steps
- Collects execution results and status
3. Pipeline
Pipeline defines a series of Tasks to be executed:
- Orchestrates multiple Tasks
- Defines execution order and dependencies
- Manages data flow between Tasks
- Supports conditional execution
Key features:
- Task dependency management
- Parameter passing between Tasks
- Workspace sharing across Tasks
- Conditional execution using
when
expressions
- Parallel execution with
runAfter
4. PipelineRun
PipelineRun is a runtime instance of a Pipeline:
- Creates TaskRuns for each Task in the Pipeline
- Manages the execution flow
- Handles resource allocation
- Collects and stores execution results
Main responsibilities:
- Orchestrating TaskRun creation
- Managing execution order
- Handling parameter passing
- Tracking overall execution status
5. Workspaces
Workspaces provide a mechanism for sharing data:
- Shared storage between Tasks
- Support for various volume types
- Flexible mounting options
- Persistent data across Task executions
Types of storage supported:
- PersistentVolumeClaims
- ConfigMaps
- Secrets
- EmptyDir volumes
- CSI (Container Storage Interface) volumes
- Projected volumes
Workflow
-
Pipeline Definition
- Define Tasks with steps
- Define Pipeline with Task dependencies
- Configure parameters and workspaces
-
Pipeline Execution
- Create a PipelineRun resource
- Controller creates TaskRuns based on dependencies
- TaskRuns create Pods to execute steps
- Results are collected and status is updated
-
Data Flow
- Parameters pass data between Pipeline components
- Workspaces share files between Tasks
- Results from Tasks can be used in subsequent Tasks
-
Completion
- All TaskRuns complete
- PipelineRun status is updated
- Results are stored and available for retrieval
Deployment Architecture
Controller Components
-
Tekton Pipeline Controller
- Watches for Tekton CRD instances
- Creates and manages Kubernetes resources
- Handles lifecycle management
- Updates status information
-
Tekton Webhook
- Validates Tekton resources
- Applies defaults
- Ensures resource consistency
-
Tekton Remote Resolvers
- Resolves Task and Pipeline definitions from remote sources
- Supports OCI bundles
- Supports Git-based resolution
- Supports HTTP-based resolution
Runtime Components
-
TaskRun Pods
- Container for each step
- Init containers for setup
- Shared volumes for workspaces
- Sidecars for special functionality
-
Resource Management
- Pod scheduling
- Resource requests and limits
- Node selection and affinity
- Priority classes
Security Architecture
Authentication Mechanisms
- Service Account Integration
- TaskRuns and PipelineRuns use ServiceAccounts
- Supports Kubernetes RBAC
- Secret management for credentials
Authorization Control
-
Resource Access Control
- Role-based access control
- Namespace isolation
- Resource quotas
-
Execution Security
- Pod security contexts
- Network policies
- Secure workspace handling
Extensibility Design
1. Custom Tasks
- Extend beyond container execution
- Custom resource implementations
- Integration with external systems
2. Remote Resolution
- Remote Task and Pipeline definitions
- Support for OCI bundles
- Git-based resolution
- HTTP-based resolution
3. Results and Metrics
- Task and Pipeline results
- Execution metrics
- Integration with observability systems
- Custom result processors