Tekton and GitHub Actions are both powerful CI/CD platforms, but they approach the problem from fundamentally different angles, making one a better fit than the other depending on your ecosystem and priorities.

Let’s see Tekton in action. Imagine a simple pipeline to build and push a Docker image.

apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: docker-build-push
spec:
  params:
    - name: IMAGE_NAME
      description: Name of the image to build and push
      type: string
      default: "my-docker-repo/my-app"
    - name: IMAGE_TAG
      description: Tag for the image
      type: string
      default: "latest"
  tasks:
    - name: build-and-push
      taskRef:
        name: buildah-build-push
      params:
        - name: IMAGE
          value: "$(params.IMAGE_NAME):$(params.IMAGE_TAG)"
        - name: BUILDER_IMAGE
          value: "quay.io/buildah/v1.26.0" # Using a specific builder image
        - name: TLSVERIFY
          value: "false" # Example: disabling TLS verification for simplicity
      runAfter: []

This Pipeline defines a single task, build-and-push, which uses a Task named buildah-build-push. The Task itself (not shown here for brevity, but it would contain the actual steps using buildah commands) is responsible for the Docker build and push. The Pipeline parameterizes the image name and tag, making it reusable.

Now, how does this actually run? A PipelineRun is created to instantiate the Pipeline.

apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  name: docker-build-push-run-1
spec:
  pipelineRef:
    name: docker-build-push
  params:
    - name: IMAGE_NAME
      value: "my-docker-registry.com/my-team/my-service"
    - name: IMAGE_TAG
      value: "v1.2.3"
  workspaces: # Required for many Tekton tasks, e.g., for source code or credentials
    - name: shared-data
      emptyDir: {}

When this PipelineRun is submitted to a Tekton controller (running within Kubernetes), Tekton orchestrates the execution. It creates Pods for each Task step, mounts necessary Workspaces (like where source code is checked out or where credentials are stored), and manages the dependencies between tasks.

The core problem Tekton solves is providing a Kubernetes-native, declarative way to define and run CI/CD pipelines. Instead of relying on external services or agents, Tekton uses Kubernetes Custom Resource Definitions (CRDs) like Task, Pipeline, and PipelineRun to define your workflows entirely within your cluster. This means your pipelines live and breathe within Kubernetes, leveraging its scheduling, scaling, and networking capabilities.

GitHub Actions, on the other hand, is a SaaS offering tightly integrated with GitHub. It uses YAML files (workflows) stored in your repository to define events that trigger jobs. These jobs run on GitHub-hosted runners or self-hosted runners.

The exact levers you control in Tekton are the Tasks and Pipelines. A Task is a collection of steps that execute sequentially. A Pipeline is a sequence of Tasks with defined dependencies. You can also define Workspaces for sharing data between tasks and Params for making your pipelines configurable. The underlying Kubernetes infrastructure handles the actual execution of these steps.

The most surprising true thing about Tekton is that it treats CI/CD as a first-class Kubernetes workload. This means you can manage your pipelines with kubectl, back them up with your cluster state, and leverage Kubernetes RBAC for fine-grained access control over who can run what pipeline. It’s not just about running commands; it’s about deploying and managing your CI/CD infrastructure as part of your application infrastructure.

The next concept you’ll likely want to explore is how to manage secrets and credentials securely within Tekton, as this is crucial for pushing artifacts or interacting with external services.

Want structured learning?

Take the full Tekton course →