Tekton

With Tekton, each operation in your CI/CD workflow becomes a Step, which is executed with a container image you specify. Steps are then organized in Tasks, which run as a Kubernetes pod in your cluster. You can further organize Tasks into Pipelines, which can control the order of execution of several Tasks.

Install Pipeline Resources

To install the core component of Tekton, Tekton Pipelines, run the command below:

kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.23.0/release.yaml

or latest

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

Set up the CLI

brew tap tektoncd/tools
brew install tektoncd/tools/tektoncd-cli
cat <<EOF | kubectl apply -f -
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: hello
spec:
  steps:
    - name: hello
      image: ubuntu
      command:
        - echo
      args:
        - "Hello World!"
EOF
tkn task start hello --dry-run | kubectl create -f -
tkn taskrun logs --last -f
cat <<EOF | kubectl apply -f -
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: goodbye
spec:
  steps:
    - name: goodbye
      image: ubuntu
      script: |
        #!/bin/bash
        echo "Goodbye World!"
EOF
tkn task start goodbye --dry-run | kubectl create -f -
tkn taskrun logs --last -f
cat <<EOF | kubectl apply -f -
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: hello-goodbye
spec:
  tasks:
  - name: hello
    taskRef:
      name: hello
  - name: goodbye
    runAfter:
     - hello
    taskRef:
      name: goodbye
EOF
tkn pipeline start hello-goodbye --dry-run | kubectl create -f -
tkn pipelinerun logs --last -f

Install Trigger Resources

To install the triggers component of Tekton, Tekton Triggers, run the command below:

kubectl apply -f https://storage.googleapis.com/tekton-releases/triggers/previous/v0.12.0/release.yaml

or latest

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

References


This project is for educational and home lab purposes.