Introduction
This documentation is for both cluster administrators and regular users:
- Administrators: Manage PAC component deployment, configuration, and maintenance
- Regular Users: Configure Git repositories and create pipelines in code
TOC
What is Pipelines as Code?
Pipelines-as-Code (PAC) is a component that enables you to define and manage Tekton Pipeline workflows directly in your source code repository. Instead of maintaining pipelines in the Kubernetes cluster, you can:
- Store pipeline definitions in Git alongside your code
- Version control pipeline configurations
- Review pipeline changes through Merge Requests
- Trigger pipelines automatically from Git events (Pull Request, Merge Request, or Push)
- Get execution status reported back to your Git provider
PAC is built on top of Tekton Pipeline, leveraging its powerful pipeline execution engine while adding Git integration capabilities.
Platform Support
PAC supports deployment on Kubernetes platforms. Although the resource name contains "OpenShift" (for historical reasons), PAC can be deployed and used on standard Kubernetes clusters through the Tekton Operator.
Prerequisites
To use PAC, you need:
Infrastructure Requirements:
- Kubernetes cluster (1.24+)
- Tekton Operator installed
- A Git repository with admin access (for webhook configuration)
- kubectl installed and configured
- tkn CLI with pac plugin (for repository configuration)
Knowledge Requirements:
- Basic understanding of Kubernetes concepts (Pods, Services, Namespaces, Custom Resources)
- Basic understanding of Tekton concepts (Pipeline, PipelineRun, Task)
- Familiarity with Git and Git providers (GitHub, GitLab, Bitbucket)
For detailed prerequisites, see Quick Start.
Core Features
PAC provides rich out-of-the-box features, including:
- Pipeline Status Tracking: Track and control pipeline status in Git providers when processing Pull Requests or Merge Requests
- Event Support: Support for Pull Request, Merge Request, and Push events
- Comment Commands: Support commands in Pull Request or Merge Request comments, such as
/retestto rerun tests - Event Filtering: Support Git event filtering and configure independent pipelines for different events
- Task Resolution: Automatically resolve tasks in pipelines (including local tasks, Tekton Hub, and remote URLs)
- CLI Tools: Provide
tkn pacCLI plugin for managing PAC Repository resources and registering webhooks. See tkn pac Command Reference for installation and usage - Git Provider Integration: Full support for multiple Git providers (GitHub, GitLab, Bitbucket Cloud, Bitbucket Data Center), webhooks, and status reporting
How It Works
PAC operates with the following core components that work together:
- Repository CR (Custom Resource): A Kubernetes custom resource that defines the connection between a Git repository and the PAC controller. It stores repository configuration, Git provider credentials, and webhook settings.
- PAC Webhook: Receives HTTP requests (webhooks) from Git providers and validates webhook signatures
- PAC Controller: Processes webhook events from Git providers, fetches pipeline definitions from Git repositories, and creates PipelineRun resources in Kubernetes
- PAC Watcher: Monitors PipelineRun execution status and reports the results back to Git providers
Component Flow
When a Git event occurs (push, pull request, merge request):
- Git provider sends webhook → PAC Webhook receives and validates the event
- PAC Webhook forwards event → PAC Controller processes the event
- PAC Controller fetches pipeline definition from Git → Creates PipelineRun in Kubernetes
- Tekton Pipeline executes the PipelineRun
- PAC Watcher monitors execution → Reports status back to Git provider
For more details, see Core Concepts.
Use Cases
PAC is suitable for the following scenarios:
-
Code-Based Pipeline Management
- Maintain pipeline definitions in source code repositories
- Version control pipeline configurations
- Review pipeline changes through Merge Requests
-
CI/CD Automation
- Automatically trigger pipelines on code push
- Run tests on Merge Requests
- Deploy applications after merge
-
Multi-Repository Workflows
- Manage pipelines for multiple repositories
- Share pipeline templates across projects
- Centralized pipeline management
Key Advantages
- Version Control: Pipeline definitions are stored in Git, enabling version control and review
- Developer-Friendly: Developers can modify pipelines without cluster access
- Transparency: Pipeline changes are visible in Merge Requests
- Consistency: Standardized pipeline definitions across projects
- Flexibility: Support for multiple Git providers (GitHub, GitLab, Bitbucket Cloud, Bitbucket Data Center) and various event types
Getting Started
If you're new to PAC, follow this learning path:
- Core Concepts - Understand PAC architecture and core concepts
- Quick Start - Deploy PAC and configure your first repository
- Manage PAC Component - Learn how to deploy, update, and maintain PAC
- Configure Repository - Set up Git repository integration
Related Documentation
- Pipeline As Code - Pipelines As Code Official Documentation
- Maintain Pipeline Code - Define and maintain pipelines in code
- Troubleshooting - Common issues and solutions