Knative Tutorial


It is assumed that you have a Kubernetes cluster either using minikube or OpenShift.

The following checks ensure that each chapter exercises are done with the right environment settings.

  • Kubernetes

  • OpenShift

  • Set your local docker to use minikube docker daemon

eval $(minikube docker-env)

  • Kubernetes should be v1.12+

kubectl version

  • OpenShift CLI should be v4.1+

oc version

The output should be like

oc version
Client Version: version.Info{Major:"4", Minor:"1+", GitVersion:"v4.1.0+b4261e0", GitCommit:"b4261e07ed", GitTreeState:"clean", BuildDate:"2019-07-06T03:16:01Z", GoVersion:"go1.12.6", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.6+73b5d76", GitCommit:"73b5d76", GitTreeState:"clean", BuildDate:"2019-09-23T16:18:51Z", GoVersion:"go1.12.8", Compiler:"gc", Platform:"linux/amd64"}
  • Make sure to be on knativetutorial OpenShift project

oc project -q

If you are not on knativetutorial project, then run following command to change to knativetutorial project:

oc project knativetutorial

Deploy Tekton Pipelines

  • Kubernetes

  • OpenShift

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:

kubectl get pods -n tekton-pipelines -w

You can use Ctrl+c to terminate the watch

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

NAME                                         READY   STATUS    RESTARTS   AGE
tekton-pipelines-controller-9b8cccff-j6hvr   1/1     Running   0          2m33s
tekton-pipelines-webhook-6fc9d4d9b6-kpkp7    1/1     Running   0          2m33s

This installation assumes that the install knative on OpenShift have been installed and verified.

The following section details on how to install openshift-pipeline(Tekton on OpenShift).

Login as admin

Login to OpenShift console using the cluster admin credentials.

Open a new terminal and start a watch on the command oc get csv -n openshift-operators. For further reference in the setup we will call this terminal as WATCH_WINDOW.

watch 'oc get csv -n openshift-operators -ocustom-columns-file=$TUTORIAL_HOME/install/csv-columns.txt'

You can terminate the watch using the command Ctrl+c

oc apply -f "$TUTORIAL_HOME/install/tektoncd-pipelines/subscription.yaml"

Wait for the subscription PHASE to be Installed before proceeding to next step. You can watch the status in the WATCH_WINDOW.

A successful openshift-pipelines subscription install should show the output in WATCH_WINDOW like:

NAME                                         VERSION               PHASE
elasticsearch-operator.4.1.20-201910102034   4.1.20-201910102034   Succeeded
jaeger-operator.v1.13.1                      1.13.1                Succeeded
kiali-operator.v1.0.6                        1.0.6                 Succeeded
knative-eventing-operator.v0.8.0             0.8.0                 Succeeded
openshift-pipelines-operator.v0.5.2          0.5.2                 Succeeded
serverless-operator.v1.0.0                   1.0.0                 Succeeded
servicemeshoperator.v1.0.1                   1.0.1                 Succeeded

It will take few minutes for the openshift-pipelines components to be installed,you can watch the status using:

oc get pods -n openshift-pipelines -w

You can terminate the watch using the command Ctrl+c

A successful OpenShift pipelines install will show the following pods in openshift-pipelines namespace:

NAME                                           READY   STATUS    RESTARTS   AGE
tekton-pipelines-controller-855f895846-jgh99   1/1     Running   0          2m20s
tekton-pipelines-webhook-c98b564d5-dtt5z       1/1     Running   0          2m21s

Congratulations! You have now installed all the OpenShift pipelines components to run the tutorial exercises. You can terminate the WATCH_WINDOW using Ctrl+c.

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.4.0