This tutorial assumes the following requirements are met:
- OpenShift 4+ cluster and oc binary tool. See docs here.
- Openshift Pipeline Operator. See docs here.
- Camel K Client Tools - Kamel. See docs here.
- Optional: Tekton CLI. See docs here.
This step will install camel operator on your ocp cluster
kamel install --cluster-setup
$ oc new-project camel-pipelines
Use this file on assets/camel-k-pipeline-permissions.yaml
$ oc apply -f camel-k-pipeline-permissions.yaml
Use this file on assets/camel-k-pipeline-task-definition.yaml
$ oc apply -f camel-k-pipeline-task-definition.yaml
Use this file on assets/pipeline-task-run.yaml
oc apply -f camel-k-pipeline-task-run.yaml
This files contains:
apiVersion: tekton.dev/v1alpha1
kind: PipelineRun
metadata:
name: camel-k-pipeline-run-1
spec:
pipelineRef:
name: camel-k-pipeline
serviceAccountName: 'camel-k-pipeline'
resources:
- name: source-repo
resourceRef:
name: camel-k-examples-git
Notes: originally it used field serviceAccount, changed to serviceAccountName due to error on tekton parsing the field serviceAccount
After successfully build and deploy, you can find deployed apps on Topology
$ tkn pipeline ls
result will be something like this
NAME AGE LAST RUN STARTED DURATION STATUS
camel-k-pipeline 1 hour ago camel-k-pipeline-d4vyhr 1 hour ago 3 minutes Succeeded