Setup

CLI tools

The following CLI tools are required for running the exercises in this tutorial. Please have them installed and configured before you get started with any of the tutorial chapters.

Tool macOS Fedora windows

Git

Download

Download

Download

Docker

Docker for Mac

dnf install docker

Docker for Windows

kubectl

Install

Install

Install

stern

brew install stern

Download

Download

yq

brew install yq

brew install yq

choco install yq

httpie

brew install httpie

dnf install httpie

https://httpie.org/doc#windows-etc

watch

brew install watch

dnf install procps-ng

Download Tutorial Sources

Before we start setting up the environment, let’s clone the tutorial sources and set the TUTORIAL_HOME environment variable to point to the root directory of the tutorial:

Before we start setting up the environment, let’s clone the tutorial sources and set the TUTORIAL_HOME environment variable to point to the root directory of the tutorial:

export TUTORIAL_HOME="$(pwd)/tekton-tutorial"
cd $TUTORIAL_HOME

This tutorial was developed and tested with:

  • Tekton v0.14.3

  • Tekton Triggers v0.6.1

  • Minikube v1.12.1+

  • OpenShift 4.5

  • Tekton CLI 0.12.0

  • Knative Client(kn) v0.16.0

Choose your Kubernetes Cluster

Knative can be installed only on Kubernetes cluster. The following section shows how to install Knative on vanilla Kubernetes or on Red Hat Openshift — an enterprise grade Kubernetes platform — 

  • Minikube

  • OpenShift

Configure and Start Minikube

Before installing Knative and its components, we need to create a Minikube virtual machine and deploy Kubernetes into it.

Download minikube and add it to your path.

$TUTORIAL_HOME/bin/start-minikube.sh
Minikube starting
❌  profile "tektontutorial" not found
βœ…  Created a new profile : tektontutorial
βœ…  minikube profile was successfully set to tektontutorial
πŸ˜„  [tektontutorial] minikube v1.12.1 on Darwin 10.15.6
✨  Automatically selected the hyperkit driver
πŸ‘  Starting control plane node tektontutorial in cluster tektontutorial
πŸ”₯  Creating hyperkit VM (CPUs=4, Memory=8192MB, Disk=51200MB) ...
🐳  Preparing Kubernetes v1.18.3 on Docker 19.03.12 ...
πŸ”Ž  Verifying Kubernetes components...
🌟  Enabled addons: default-storageclass, storage-provisioner
πŸ„  Done! kubectl is now configured to use "tektontutorial"

Switch to the new minikube profile tektontutorial, so that all your commands gets executed in the right context:

minikube profile tektontutorial
βœ…  minikube profile was successfully set to tektontutorial

Deploy Registry Helper

To enable pushing and pulling container images from local internal minikube registry, we will deploy the minikube registry-aliases addon:

minikube addons enable registry && minikube addons enable registry-aliases
πŸ”Ž  Verifying registry addon...
🌟  The 'registry' addon is enabled
🌟  The 'registry-aliases' addon is enabled

The registry-aliases addon should allow you to build local container images with names like:

  • example.com/foo/bar

  • example.org/foo/bar

  • test.com/foo/bar

  • test.org/foo/bar

The images build with the example.org, example.com, test.com and test.org will then be pushed and pulled from local internal registry, which was enable using minkube registry addon.

Deploy Tekton Pipelines

To deploy the Tekton pipelines:

It will take few mins for the Tekton pipeline components to be installed, you an watch the status using the command:

watch kubectl get pods -n tekton-pipelines

You can use Ctrl+c to terminate the watch

A successful deployment of Tekton pipelines will show the following pods:

NAME                                           READY   STATUS    AGE
tekton-pipelines-controller-849ccccd7f-gc6dp   1/1     Running   85s
tekton-pipelines-webhook-75bc7666c-9crwq       1/1     Running   85s

Install Tekton CLI

Tekton CLI is command line utility used to interact with the Tekton resources.

Download the Tekton cli and add to your path:

Verify the Tekton cli

tkn version

The command should show a result like:

Client version: 0.12.0
Pipeline version: v0.14.3
Triggers version: unknown
Since Tekton Triggers is not installed, the version is shown as unknown

Configuring Kubernetes namespace

All the tutorial exercises will be deployed in namespace called tektontutorial:

kubectl create namespace tektontutorial &&\
kubectl config set-context --current --namespace=tektontutorial

The following section details on how to install OpenShift Pipelines(Tekton on OpenShift).

== Login as Cluster Admin

Login to OpenShift console using the cluster admin credentials. Follow the OpenShift Documentation to have OpenShift Pipelines installed in your OpenShift cluster.

Unless and until explictiy quoted, all the tutorial exercises will be deployed in namespace called tektontutorial:

oc new-project tektontutorial

You have now installed all the OpenShift pipelines components to run the tutorial exercises.