Overview
Tekton is a Kubernetes-native CI/CD framework. Tasks define individual steps, Pipelines compose Tasks, Triggers respond to events, and Workspaces share data between steps.
Capabilities
- Kubernetes-native CI/CD primitives
- Reusable Tasks and Pipelines from Tekton Hub
- Event-based triggers with webhooks
- Workspaces for data sharing between steps
- Custom Task types for specialized workloads
- Dashboard for pipeline visualization
When to Use
Trigger phrases:
"tekton pipelines"
"Running CI/CD on Kubernetes clusters"
"Need cloud-native, vendor-neutral pipeline definitions"
"Want reusable, composable CI/CD building blocks"
Running CI/CD on Kubernetes clusters
Need cloud-native, vendor-neutral pipeline definitions
Want reusable, composable CI/CD building blocks
Building platform engineering CI/CD foundations
When NOT to Use
- Task is outside your authorization scope
- You need to implement controls (use implementing-* skills)
- Task is about analysis, not action (use analyzing-* skills)
- You don't have access to target systems
- Task requires compliance expertise (consult professionals)
- Task is about defense, not offense (use defensive skills)
Pseudo Code
The tekton-pipelines workflow follows a standard pipeline pattern.
Core flow:
# tekton-pipelines primary flow
input = prepare(raw_data)
result = process(input, config={kubernetes, native, pipelines, tasks, tekton})
validate(result)
deliver(result)
Error handling:
on error:
log(error_details)
retry_with_backoff(max=3)
if still_failing: alert_and_escalate()
Task Definition
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: build-and-push
spec:
params:
- name: image
type: string
workspaces:
- name: source
steps:
- name: build
image: gcr.io/kaniko-project/executor:latest
args:
- --dockerfile=$(workspaces.source.path)/Dockerfile
- --context=$(workspaces.source.path)
- --destination=$(params.image)
Pipeline Definition
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: build-test-deploy
spec:
params:
- name: image
type: string
workspaces:
- name: shared-workspace
tasks:
- name: clone
taskRef:
name: git-clone
workspaces:
- name: output
workspace: shared-workspace
- name: build
taskRef:
name: build-and-push
runAfter: [clone]
params:
- name: image
value: $(params.image)
workspaces:
- name: source
workspace: shared-workspace
- name: test
taskRef:
name: run-tests
runAfter: [build]
workspaces:
- name: source
workspace: shared-workspace
Trigger (Webhook)
apiVersion: triggers.tekton.dev/v1beta1
kind: TriggerTemplate
metadata:
name: build-on-push
spec:
resourcetemplates:
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: build-$(uid)
spec:
pipelineRef:
name: build-test-deploy
params:
- name: image
value: registry.example.com/app:$(tt.params.git-sha)
Common Patterns
- Task Hub:
tkn hub search git-clone — find community Tasks
- Workspaces: PVC for persistent data, ConfigMap for config, emptyDir for temp
- Results: Tasks can output results consumed by downstream Tasks
- When expressions:
when: [{ input: "$(params.run-tests)", operator: in, values: ["true"] }]
- Sidecars: Run services alongside Tasks (e.g., Docker-in-Docker)
How to Use
- Define infrastructure as code (Terraform, CloudFormation, Pulumi)
- Review changes through PR process before applying
- Configure monitoring and alerting for critical paths
- Set up secrets management (Vault, AWS Secrets Manager, etc.)
- Document runbooks for deployment, rollback, and incident response
- Test disaster recovery procedures regularly
Red Flags
- Infrastructure changes without review: Unreviewed changes cause outages — use PRs for infra code
- No rollback strategy: Every deployment needs a tested rollback plan before it runs
- Secrets in configuration files: Secrets in YAML/JSON get committed to version control
- Missing monitoring and alerting: Without monitoring, outages go undetected until users report them
- No documentation for runbooks: Without runbooks, on-call engineers waste time re-discovering procedures
Verification
Process
- Analyze the task requirements
- Apply domain expertise
- Verify output quality
Anti-Rationalization Table
| Rationalization |
Reality |
| "Manual deployments are fine" |
Manual deployments are error-prone and不可 repeatable. Automate. |
| "We do not need monitoring" |
Without monitoring, you are flying blind. Add observability from day one. |
| "Infrastructure as code is overkill" |
IaC enables reproducibility, version control, and disaster recovery. |
1---2name: tekton-pipelines3description: Use when tekton CI/CD pipelines — Tasks, Pipelines, Triggers, Workspaces4 for Kubernetes-native CI. Use when working with tekton pipelines.5domain: devops6author: oyi777license: Apache-2.08subdomain: devops9tags:10- ci-cd11- devops12- infrastructure13- kubernetes14- pipeline15- pipelines16- tekton17version: 1.0.018category: devops19metadata:20 source: https://skillmd.com/skills/oyi77/tekton-pipelines21---22232425## Overview2627Tekton is a Kubernetes-native CI/CD framework. Tasks define individual steps, Pipelines compose Tasks, Triggers respond to events, and Workspaces share data between steps.2829## Capabilities3031- Kubernetes-native CI/CD primitives32- Reusable Tasks and Pipelines from Tekton Hub33- Event-based triggers with webhooks34- Workspaces for data sharing between steps35- Custom Task types for specialized workloads36- Dashboard for pipeline visualization3738## When to Use3940**Trigger phrases:**41- "tekton pipelines"42- "Running CI/CD on Kubernetes clusters"43- "Need cloud-native, vendor-neutral pipeline definitions"44- "Want reusable, composable CI/CD building blocks"454647- Running CI/CD on Kubernetes clusters48- Need cloud-native, vendor-neutral pipeline definitions49- Want reusable, composable CI/CD building blocks50- Building platform engineering CI/CD foundations5152## When NOT to Use5354- Task is outside your authorization scope55- You need to implement controls (use implementing-* skills)56- Task is about analysis, not action (use analyzing-* skills)57- You don't have access to target systems58- Task requires compliance expertise (consult professionals)59- Task is about defense, not offense (use defensive skills)606162## Pseudo Code6364The tekton-pipelines workflow follows a standard pipeline pattern.6566Core flow:67```68# tekton-pipelines primary flow69input = prepare(raw_data)70result = process(input, config={kubernetes, native, pipelines, tasks, tekton})71validate(result)72deliver(result)73```7475Error handling:76```77on error:78 log(error_details)79 retry_with_backoff(max=3)80 if still_failing: alert_and_escalate()81```828384### Task Definition85```yaml86apiVersion: tekton.dev/v1beta187kind: Task88metadata:89 name: build-and-push90spec:91 params:92 - name: image93 type: string94 workspaces:95 - name: source96 steps:97 - name: build98 image: gcr.io/kaniko-project/executor:latest99 args:100 - --dockerfile=$(workspaces.source.path)/Dockerfile101 - --context=$(workspaces.source.path)102 - --destination=$(params.image)103```104105### Pipeline Definition106```yaml107apiVersion: tekton.dev/v1beta1108kind: Pipeline109metadata:110 name: build-test-deploy111spec:112 params:113 - name: image114 type: string115 workspaces:116 - name: shared-workspace117 tasks:118 - name: clone119 taskRef:120 name: git-clone121 workspaces:122 - name: output123 workspace: shared-workspace124 - name: build125 taskRef:126 name: build-and-push127 runAfter: [clone]128 params:129 - name: image130 value: $(params.image)131 workspaces:132 - name: source133 workspace: shared-workspace134 - name: test135 taskRef:136 name: run-tests137 runAfter: [build]138 workspaces:139 - name: source140 workspace: shared-workspace141```142143### Trigger (Webhook)144```yaml145apiVersion: triggers.tekton.dev/v1beta1146kind: TriggerTemplate147metadata:148 name: build-on-push149spec:150 resourcetemplates:151 - apiVersion: tekton.dev/v1beta1152 kind: PipelineRun153 metadata:154 name: build-$(uid)155 spec:156 pipelineRef:157 name: build-test-deploy158 params:159 - name: image160 value: registry.example.com/app:$(tt.params.git-sha)161```162163## Common Patterns164165- **Task Hub**: `tkn hub search git-clone` — find community Tasks166- **Workspaces**: PVC for persistent data, ConfigMap for config, emptyDir for temp167- **Results**: Tasks can output results consumed by downstream Tasks168- **When expressions**: `when: [{ input: "$(params.run-tests)", operator: in, values: ["true"] }]`169- **Sidecars**: Run services alongside Tasks (e.g., Docker-in-Docker)170171## How to Use1721731. Define infrastructure as code (Terraform, CloudFormation, Pulumi)1742. Review changes through PR process before applying1753. Configure monitoring and alerting for critical paths1764. Set up secrets management (Vault, AWS Secrets Manager, etc.)1775. Document runbooks for deployment, rollback, and incident response1786. Test disaster recovery procedures regularly179180## Red Flags181182- **Infrastructure changes without review**: Unreviewed changes cause outages — use PRs for infra code183- **No rollback strategy**: Every deployment needs a tested rollback plan before it runs184- **Secrets in configuration files**: Secrets in YAML/JSON get committed to version control185- **Missing monitoring and alerting**: Without monitoring, outages go undetected until users report them186- **No documentation for runbooks**: Without runbooks, on-call engineers waste time re-discovering procedures187188## Verification189190- [ ] Skill output matches expected behavior191192## Process1931941. Analyze the task requirements1952. Apply domain expertise1963. Verify output quality197198## Anti-Rationalization Table199200| Rationalization | Reality |201|---|---|202| "Manual deployments are fine" | Manual deployments are error-prone and不可 repeatable. Automate. |203| "We do not need monitoring" | Without monitoring, you are flying blind. Add observability from day one. |204| "Infrastructure as code is overkill" | IaC enables reproducibility, version control, and disaster recovery. |