// Tekton Pipelines CI/CD best practices for Kubernetes-native workflows. USE WHEN working with Tekton tasks, pipelines, triggers, building container images, GitOps integration, or cloud-native CI/CD.
| name | Tekton |
| description | Tekton Pipelines CI/CD best practices for Kubernetes-native workflows. USE WHEN working with Tekton tasks, pipelines, triggers, building container images, GitOps integration, or cloud-native CI/CD. |
Expert guidance on Tekton Pipelines, a Kubernetes-native CI/CD framework for building, testing, and deploying applications with declarative, reusable workflows.
This skill activates when:
tkn CLI commandstekton.dev/v1 or triggers.tekton.dev API versionsWhen executing a workflow, output this notification directly:
Running the **WorkflowName** workflow from the **Tekton** skill...
| Workflow | Trigger | File |
|---|---|---|
| Debug | "debug pipeline", "troubleshoot task", "pipeline failing", "taskrun error" | workflows/Debug.md |
| TknCli | "tkn command", "view logs", "pipeline run", "task run" | workflows/TknCli.md |
| Tasks | "create task", "task definition", "step", "taskrun" | workflows/Tasks.md |
| Pipelines | "create pipeline", "pipeline workflow", "pipelinerun" | workflows/Pipelines.md |
| Triggers | "webhook", "eventlistener", "trigger", "github integration" | workflows/Triggers.md |
| Build | "build image", "kaniko", "buildah", "container build" | workflows/Build.md |
| GitOps | "argocd", "flux", "gitops integration", "deployment automation" | workflows/GitOps.md |
| BestPractices | "tekton best practices", "optimization", "security" | workflows/BestPractices.md |
# Pipeline operations
tkn pipeline list
tkn pipeline describe <pipeline-name>
tkn pipeline start <pipeline-name>
tkn pipeline delete <pipeline-name>
# PipelineRun operations
tkn pipelinerun list
tkn pipelinerun describe <pipelinerun-name>
tkn pipelinerun logs <pipelinerun-name> -f
tkn pipelinerun cancel <pipelinerun-name>
tkn pipelinerun delete <pipelinerun-name>
# Task operations
tkn task list
tkn task start <task-name>
tkn taskrun logs <taskrun-name> -f
# ClusterTask operations (deprecated - use resolvers)
tkn clustertask list
alias tkn-logs='tkn pipelinerun logs --last -f'
alias tkn-list='tkn pipelinerun list'
alias tkn-desc='tkn pipelinerun describe --last'
alias tkn-cancel='tkn pipelinerun cancel --last'
Task: Single unit of work with one or more Steps
Pipeline: Orchestrates multiple Tasks
Trigger: Event-driven pipeline execution
Workspace: Shared filesystem storage
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: hello-world
spec:
params:
- name: greeting
description: The greeting message
default: "Hello"
steps:
- name: echo
image: alpine
script: |
echo "$(params.greeting), World!"
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: build-deploy
spec:
params:
- name: git-url
- name: image-name
workspaces:
- name: shared-data
tasks:
- name: clone
taskRef:
name: git-clone
workspaces:
- name: output
workspace: shared-data
params:
- name: url
value: $(params.git-url)
- name: build
taskRef:
name: kaniko
runAfter:
- clone
workspaces:
- name: source
workspace: shared-data
params:
- name: IMAGE
value: $(params.image-name)
1. Git Clone → Fetch source code
2. Test → Run unit/integration tests
3. Build → Build container image (Kaniko/Buildah)
4. Scan → Security scan (Trivy)
5. Push → Push to container registry
6. Deploy → Update GitOps repo or deploy directly
Sequential execution:
- name: build
runAfter:
- test
Parallel execution:
- name: lint
# No runAfter - runs in parallel
- name: test
# No runAfter - runs in parallel
Conditional execution:
- name: deploy-prod
when:
- input: "$(params.environment)"
operator: in
values: ["production"]
Cleanup (always runs):
finally:
- name: cleanup
taskRef:
name: cleanup-workspace
Reference tasks from Tekton Hub:
taskRef:
resolver: hub
params:
- name: name
value: git-clone
- name: version
value: "0.10.0"
Popular Hub Tasks:
git-clone: Clone Git repositorieskaniko: Build and push container imageskubernetes-actions: Run kubectl commandshelm-upgrade: Deploy Helm chartstrivy-scanner: Security scanningBrowse tasks: https://hub.tekton.dev
This Tekton skill builds on the Kubernetes skill:
Before using Tekton, ensure you're familiar with:
# View pipeline run status
tkn pipelinerun describe <name>
# Stream logs
tkn pipelinerun logs <name> -f
# Check why task failed
kubectl describe taskrun <taskrun-name>
# View events
kubectl get events --sort-by=.metadata.creationTimestamp
# Check pod logs directly
kubectl logs <pod-name> -c step-<step-name>
# Debug container
kubectl debug -it <pod-name> --image=alpine --target=<container>
Example 1: Create CI pipeline
User: "Create a Tekton pipeline that clones a repo, runs tests, and builds a container image"
→ Invokes Pipelines workflow
→ Creates pipeline with git-clone, test, and kaniko tasks
→ Configures workspaces for source sharing
→ Sets up proper task dependencies
Example 2: Set up GitHub webhook
User: "Set up GitHub webhook to trigger my pipeline on push"
→ Invokes Triggers workflow
→ Creates EventListener with GitHub interceptor
→ Configures TriggerBinding to extract commit info
→ Sets up TriggerTemplate to start PipelineRun
Example 3: Integrate with ArgoCD
User: "How do I integrate Tekton with ArgoCD for GitOps?"
→ Invokes GitOps workflow
→ Explains CI (Tekton) vs CD (ArgoCD) separation
→ Shows how Tekton updates GitOps repo
→ ArgoCD syncs changes to cluster
Install Tekton Pipelines:
kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
Install Tekton Triggers:
kubectl apply --filename https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml
Install tkn CLI:
# macOS
brew install tektoncd-cli
# Linux
curl -LO https://github.com/tektoncd/cli/releases/latest/download/tkn_<version>_Linux_x86_64.tar.gz
sudo tar xvzf tkn_<version>_Linux_x86_64.tar.gz -C /usr/local/bin/ tkn
Verify installation:
kubectl get pods -n tekton-pipelines
tkn version