TektonPipeline
TektonPipeline is a custom resource provided by the Tekton Operator that allows you to install, update, and manage Tekton Pipelines in your Kubernetes cluster. It provides a declarative way to configure and maintain your Tekton Pipeline components without manually applying manifests.
TOC
Terminology ExplanationWhy We Need TektonPipelineThe Challenge of Managing Tekton ComponentsHow TektonPipeline Addresses These ProblemsAdvantagesApplicable ScenariosConstraints and LimitationsPrinciplesTektonPipeline StructureKey Components and Their RelationshipsConfiguration ExamplesBasic InstallationCustomized Installation with Feature FlagsHigh Availability ConfigurationImportant Parameter Explanations Related to TektonPipelineFeature FlagsApplicable ScenariosConstraints and LimitationsPrinciples/Parameter ExplanationMetrics PropertiesApplicable ScenariosConfiguration ExamplesPerformance ConfigurationApplicable ScenariosConfiguration ExamplesReference MaterialsTerminology Explanation
Why We Need TektonPipeline
The Challenge of Managing Tekton Components
Manually installing and maintaining Tekton Pipeline components involves:
- Applying multiple manifests for different components
- Keeping track of component versions and their compatibility
- Managing upgrades and rollbacks safely
- Configuring components consistently across environments
- Handling custom configurations for specific deployments
This approach leads to:
- Complex management procedures
- Potential for misconfiguration
- Difficulty in tracking the deployed state
- Challenges in implementing consistent upgrades
How TektonPipeline Addresses These Problems
The TektonPipeline resource provides a declarative, Kubernetes-native way to:
- Simplify installation: Install all Pipeline components with a single resource
- Centralize configuration: Manage all component settings in one place
- Automate upgrades: Easily upgrade to new versions by updating the resource
- Ensure consistency: Apply the same configuration across different environments
- Support customization: Customize Pipeline components based on specific requirements
This approach enables better management of Tekton Pipeline components while maintaining the flexibility to customize as needed.
Advantages
- Simplified management: Single resource to manage all Pipeline components
- Declarative configuration: Define the desired state and let the operator handle implementation details
- Version control: Easy tracking of configuration changes through GitOps practices
- Automated reconciliation: Operator ensures the actual state matches the desired state
- Configuration validation: Built-in validation of configuration parameters
- Streamlined upgrades: Simplified process for upgrading to new versions
- Kubernetes-native: Integrates seamlessly with the Kubernetes ecosystem
Applicable Scenarios
TektonPipeline is essential in the following scenarios:
-
Initial Deployment: Setting up Tekton Pipeline in a new Kubernetes cluster.
-
Configuration Management: Managing Pipeline configuration changes over time.
-
Version Upgrades: Upgrading Tekton Pipeline to newer versions.
-
Multi-Cluster Deployments: Ensuring consistent Pipeline deployment across multiple clusters.
-
Custom Deployments: Implementing specific Pipeline configurations for different environments.
-
GitOps Workflows: Including Pipeline configuration in GitOps deployment processes.
Constraints and Limitations
- Requires the Tekton Operator to be installed in the cluster
- Some advanced configurations may require other Tekton Operator resources
- Changes to certain fields may require component restarts
- Must follow Kubernetes resource management principles
Principles
TektonPipeline Structure
A TektonPipeline resource has the following structure:
Key Components and Their Relationships
-
targetNamespace: Where Tekton Pipeline components will be installed
- Default is "tekton-pipelines"
- All Pipeline components will be created in this namespace
- Make sure you have permissions to create resources in this namespace
-
version: The version of Tekton Pipeline to install
- Can specify a specific version like "v0.45.0"
- Omitting this field will install the latest version supported by the operator
-
Feature flags: Many configuration options to control Pipeline behavior
disable-affinity-assistant: Controls affinity assistant behaviordisable-creds-init: Controls credential initializationenable-api-fields: Controls which API fields are enabledenable-custom-tasks: Enables the use of custom tasks- And many more as shown in the full structure above
-
performance: Settings for high-availability and performance tuning
replicas: Number of controller replicasbuckets: Number of buckets for the controllerthreads-per-controller: Number of worker threads per controllerstatefulset-ordinals: Enables StatefulSet Ordinals mode
Configuration Examples
Basic Installation
Customized Installation with Feature Flags
High Availability Configuration
Important Parameter Explanations Related to TektonPipeline
Feature Flags
Feature flags control specific behaviors of the Pipeline controller.
Applicable Scenarios
- Disabling the affinity assistant for performance reasons
- Enabling or disabling specific Pipeline features
- Configuring environment-specific settings
Constraints and Limitations
- Some feature flags might be deprecated in future versions
- Changing certain flags may require pipeline reruns
- Compatibility considerations between different flags
Principles/Parameter Explanation
Common feature flags include:
-
disable-affinity-assistant (Default:
false): Setting this flag to "true" will prevent Tekton from creating an Affinity Assistant for every TaskRun sharing a PVC workspace. -
disable-creds-init (Default:
false): Setting this flag to "true" will prevent Tekton scanning attached service accounts and injecting any credentials it finds into your Steps. -
await-sidecar-readiness (Default:
true): Controls whether to wait for sidecar containers to be running before starting a TaskRun's first step. -
running-in-environment-with-injected-sidecars (Default:
true): Should be set to false when Pipelines is running in a cluster that does not use injected sidecars such as Istio. -
enable-custom-tasks (Default:
false): Enables the use of custom tasks from within pipelines.
Metrics Properties
Metrics properties control how metrics are collected and reported.
Applicable Scenarios
- Setting up monitoring for Tekton pipelines
- Customizing metric collection behavior
- Integrating with observability systems
Configuration Examples
Performance Configuration
The performance section allows for tuning the controller's performance characteristics.
Applicable Scenarios
- Scaling for high-volume pipeline execution
- Optimizing resource usage
- Implementing high-availability configurations