Skip to main content
πŸŽ“ Claude Code Masterclass Learn AI-assisted development on Udemy β€” plus the companion book on Leanpub & Amazon. Start Learning
Tekton: Cloud-Native CI/CD Pipelines on Kubernetes
DevOps

Tekton: Cloud-Native CI/CD Pipelines on Kubernetes

Build CI/CD pipelines as Kubernetes resources with Tekton β€” Tasks, Pipelines, Triggers, and integration with Argo CD for full GitOps.

LB
Luca Berton
Β· 1 min read

What Is Tekton?

Tekton provides Kubernetes-native CI/CD β€” pipelines defined as CRDs, running as pods, with no external CI server. Part of the CD Foundation (Linux Foundation).

Why Tekton over Jenkins/GitHub Actions?

FeatureTektonJenkinsGitHub Actions
Runs onKubernetes (native)JVM (standalone)GitHub cloud
Defined asK8s CRDsGroovy/XMLYAML
ScalabilityPod-per-task (infinite)Executor agentsRunner limits
Self-hostedβœ…βœ…βš οΈ (runners)
GitOps nativeβœ… (resources in Git)❌❌
Vendor lock-inNone (CDF standard)NoneGitHub

Core Concepts

Pipeline
β”œβ”€β”€ Task 1 (clone)
β”‚   └── Step 1: git clone
β”œβ”€β”€ Task 2 (build)
β”‚   β”œβ”€β”€ Step 1: compile
β”‚   └── Step 2: test
β”œβ”€β”€ Task 3 (image)
β”‚   β”œβ”€β”€ Step 1: docker build
β”‚   └── Step 2: docker push
└── Task 4 (deploy)
    └── Step 1: kubectl apply

Installation

kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
kubectl apply -f https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml
kubectl apply -f https://storage.googleapis.com/tekton-releases/dashboard/latest/release.yaml

Task Definition

apiVersion: tekton.dev/v1
kind: Task
metadata:
  name: build-and-push
spec:
  params:
    - name: image
      type: string
    - name: dockerfile
      type: string
      default: ./Dockerfile
  workspaces:
    - name: source
  steps:
    - name: build
      image: gcr.io/kaniko-project/executor:latest
      args:
        - --dockerfile=$(params.dockerfile)
        - --destination=$(params.image)
        - --context=$(workspaces.source.path)
        - --cache=true

Pipeline

apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
  name: build-deploy
spec:
  params:
    - name: repo-url
    - name: image
    - name: namespace
  workspaces:
    - name: shared-workspace
  tasks:
    - name: clone
      taskRef:
        name: git-clone  # From Tekton Hub
      params:
        - name: url
          value: $(params.repo-url)
      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: deploy
      taskRef:
        name: kubernetes-actions
      runAfter: [build]
      params:
        - name: script
          value: |
            kubectl set image deployment/app app=$(params.image) -n $(params.namespace)

Triggers (Webhook β†’ Pipeline)

apiVersion: triggers.tekton.dev/v1beta1
kind: EventListener
metadata:
  name: github-listener
spec:
  triggers:
    - name: github-push
      bindings:
        - ref: github-push-binding
      template:
        ref: build-deploy-template
---
apiVersion: triggers.tekton.dev/v1beta1
kind: TriggerBinding
metadata:
  name: github-push-binding
spec:
  params:
    - name: repo-url
      value: $(body.repository.clone_url)
    - name: revision
      value: $(body.head_commit.id)

Tekton + Argo CD (Full GitOps)

GitHub Push β†’ Tekton (build + test + push image) β†’ Update Git manifest β†’ Argo CD syncs

Tekton handles CI (build artifacts), Argo CD handles CD (deploy to cluster). Clean separation.

Free 30-min AI & Cloud consultation

Book Now