Deploy tekton in Openshift 4.2
The following documentation has been tested on a lab / Dev Environment. For a PROD usage, please check the official documentation
Tekton is Kubernetes-native pipeline resource
The Tekton Pipelines project provides Kubernetes-style resources for declaring CI/CD-style pipelines.
The main objective of Tekton Pipelines is to run your Task individually or as a part of a Pipeline. Every Task runs as a Pod on your Kubernetes cluster with each step as its own container.
We've performed our deployment based on the following documentation:
Assuming we a have a local openshift 4.2 or kubernetes cluster, first we will need to create a PV and a PVC for the storage. You can use the following yaml file as an example.
Create 2 files named pv.yaml and pvc.taml with the following content:
kind: PersistentVolume apiVersion: v1 metadata: name: config-logging labels: type: local spec: capacity: storage: 40Gi accessModes: - ReadWriteMany hostPath: path: "/mnt/glusterfs/config-logging"
kind: PersistentVolumeClaim apiVersion: v1 metadata: name: config-logging namespace: tekton-pipelines spec: accessModes: - ReadWriteMany resources: requests: storage: 40Gi volumeName: config-logging volumeMode: Filesystem
Then, create the volumes by typing
oc create namespace tekton-pipelines oc create -f pv.yaml oc create -f pvc.yaml
As per the document, download the official release yaml file
Before applying the file, we need to modify the following 2 iterations in order to use our local storage
volumes: - configMap: name: config-logging name: config-logging
volumes: - name: config-logging persistentVolumeClaim: claimName: config-logging
then, perform the deployment by executing:
oc apply -f release.yaml
And then verify that the pods are up and running by using:
oc get pods --namespace tekton-pipelines NAME READY STATUS RESTARTS AGE tekton-pipelines-controller-8b78bdf57-qmrlx 1/1 Running 0 22m tekton-pipelines-webhook-66987c8b96-d9vsq 1/1 Running 0 22m
Once up and running, we can also download the tekton dashboard from its git repo
There's no need to edit the yaml file here, so we can apply it straight forward:
oc apply -f dashboard_latest_release.yaml
Verify again your pods, and create an ingress (in kubernetes) or a route in openshift and access the dashboard
As a final step, to ensure that the pipelines that we create have the appropriate permissions to store images and perform the deployments, we need to create a Service account:
oc create serviceaccount pipeline oc adm policy add-scc-to-user privileged -z pipeline oc adm policy add-role-to-user edit -z pipeline