docker.recipes

Tekton CI/CD Pipeline

advanced

Tekton Pipelines for Kubernetes-native CI/CD.

Overview

Tekton Pipelines is a Kubernetes-native CI/CD framework originally developed by Google and now maintained by the Continuous Delivery Foundation. It provides cloud-native pipeline execution using custom resource definitions (CRDs) that define reusable, declarative CI/CD workflows directly within Kubernetes clusters. Unlike traditional CI/CD tools that run as standalone services, Tekton leverages Kubernetes' native scheduling, scaling, and resource management capabilities to execute pipeline tasks as pods. This stack combines Tekton Pipelines with a local Docker registry and KinD (Kubernetes in Docker) cluster to create a complete CI/CD development environment. The KinD cluster hosts the Tekton installation including the dashboard for visual pipeline management, while the Docker registry serves as a local image repository for build artifacts. This configuration eliminates external dependencies and provides a self-contained environment for developing, testing, and debugging Tekton pipelines before deploying to production Kubernetes clusters. This setup is ideal for DevOps engineers learning Tekton, platform teams building internal CI/CD standards, and organizations wanting to prototype cloud-native pipelines without cloud infrastructure costs. The combination provides enterprise-grade pipeline capabilities with the convenience of local development, making it particularly valuable for teams transitioning from Jenkins or other traditional CI/CD tools to Kubernetes-native solutions.

Key Features

  • Tekton Dashboard web interface for visual pipeline monitoring and task execution tracking
  • Cloud-native pipeline execution using Kubernetes pods with automatic resource cleanup
  • Local Docker registry integration for storing and serving container images during builds
  • KinD cluster providing full Kubernetes API compatibility for realistic pipeline testing
  • Tekton Triggers support for webhook-based pipeline automation from Git repositories
  • Custom Resource Definitions for defining reusable Tasks, Pipelines, and PipelineRuns
  • Built-in workspace volume management for sharing data between pipeline steps
  • RBAC integration using Kubernetes service accounts for secure pipeline execution

Common Use Cases

  • 1Learning Tekton Pipelines syntax and concepts without requiring cloud Kubernetes clusters
  • 2Developing and testing custom Tekton Tasks before deploying to production environments
  • 3Prototyping multi-stage CI/CD workflows for containerized applications with local image builds
  • 4Training development teams on cloud-native CI/CD practices using Kubernetes primitives
  • 5Building internal platform engineering demos showcasing Tekton capabilities to stakeholders
  • 6Testing Tekton Catalog tasks and community-contributed pipeline components locally
  • 7Validating pipeline security policies and RBAC configurations in isolated environments

Prerequisites

  • Docker Desktop or Docker Engine with at least 8GB RAM allocated for KinD cluster operation
  • kubectl CLI tool installed and configured for Kubernetes cluster management
  • tkn CLI tool for creating and managing Tekton pipeline resources from command line
  • Basic understanding of Kubernetes concepts including pods, services, and custom resources
  • Familiarity with YAML syntax for writing Tekton Task and Pipeline definitions
  • Local ports 5000, 6443, and 9097 available for registry, Kubernetes API, and dashboard access

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 kind:
3 image: kindest/node:v1.28.0
4 container_name: tekton-cluster
5 privileged: true
6 ports:
7 - "${API_PORT:-6443}:6443"
8 - "${DASHBOARD_PORT:-9097}:30097"
9 volumes:
10 - kind_data:/var/lib/containerd
11
12 registry:
13 image: registry:2
14 container_name: tekton-registry
15 restart: unless-stopped
16 ports:
17 - "${REGISTRY_PORT:-5000}:5000"
18 volumes:
19 - registry_data:/var/lib/registry
20
21volumes:
22 kind_data:
23 registry_data:

.env Template

.env
1# Tekton CI/CD
2API_PORT=6443
3DASHBOARD_PORT=9097
4REGISTRY_PORT=5000

Usage Notes

  1. 1Requires Docker privileged mode
  2. 2Tekton Dashboard at http://localhost:9097
  3. 3Local registry at localhost:5000
  4. 4Install tkn CLI for pipelines

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

kind
kind:
  image: kindest/node:v1.28.0
  container_name: tekton-cluster
  privileged: true
  ports:
    - ${API_PORT:-6443}:6443
    - ${DASHBOARD_PORT:-9097}:30097
  volumes:
    - kind_data:/var/lib/containerd
registry
registry:
  image: registry:2
  container_name: tekton-registry
  restart: unless-stopped
  ports:
    - ${REGISTRY_PORT:-5000}:5000
  volumes:
    - registry_data:/var/lib/registry

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 kind:
5 image: kindest/node:v1.28.0
6 container_name: tekton-cluster
7 privileged: true
8 ports:
9 - "${API_PORT:-6443}:6443"
10 - "${DASHBOARD_PORT:-9097}:30097"
11 volumes:
12 - kind_data:/var/lib/containerd
13
14 registry:
15 image: registry:2
16 container_name: tekton-registry
17 restart: unless-stopped
18 ports:
19 - "${REGISTRY_PORT:-5000}:5000"
20 volumes:
21 - registry_data:/var/lib/registry
22
23volumes:
24 kind_data:
25 registry_data:
26EOF
27
28# 2. Create the .env file
29cat > .env << 'EOF'
30# Tekton CI/CD
31API_PORT=6443
32DASHBOARD_PORT=9097
33REGISTRY_PORT=5000
34EOF
35
36# 3. Start the services
37docker compose up -d
38
39# 4. View logs
40docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/tekton-cicd-stack/run | bash

Troubleshooting

  • Tekton Dashboard shows 'connection refused' errors: Verify KinD cluster is fully started and port 9097 is forwarded correctly to the dashboard service
  • Pipeline runs fail with 'ImagePullBackOff' errors: Ensure images are pushed to localhost:5000 registry and cluster is configured to use insecure local registry
  • Tasks timeout during execution: Increase resource limits in TaskRun specifications or allocate more memory to Docker Desktop
  • KinD cluster fails to start: Check Docker has sufficient resources allocated and no other services are using port 6443
  • Registry push operations fail with authentication errors: Configure Docker daemon to treat localhost:5000 as insecure registry in daemon.json
  • Tekton webhooks not triggering pipelines: Verify Tekton Triggers are installed and EventListener services are exposed correctly

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space