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 |
|||
|
|
||
|
|||
|
|||
brew install yq |
brew install yq |
choco install yq |
|
|
|
||
watch |
|
|
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:
git clone https://github.com/redhat-scholars/tekton-tutorial tekton-tutorial
export TUTORIAL_HOME="$(pwd)/tekton-tutorial"
cd $TUTORIAL_HOME
This tutorial was developed and tested with:
|
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 —
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
β 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:
kubectl apply --filename \
https://github.com/tektoncd/pipeline/releases/download/v0.14.3/release.yaml
It will take few mins for the Tekton pipeline components to be installed, you an watch the status using the command:
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.