Skip to content

Latest commit

 

History

History
70 lines (62 loc) · 2.87 KB

camel-k-deploy-using-tekton.md

File metadata and controls

70 lines (62 loc) · 2.87 KB

Deploy with Camel-K using Tekton on OCP

Prerequisite

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.

Step 1: Cluster setup

This step will install camel operator on your ocp cluster

kamel install --cluster-setup

Step 2: Create namespace

$ oc new-project camel-pipelines

Step 3: Create permission for serviceaccounts

Use this file on assets/camel-k-pipeline-permissions.yaml

$ oc apply -f camel-k-pipeline-permissions.yaml

Step 4: Create tekton pipeline

Use this file on assets/camel-k-pipeline-task-definition.yaml

$ oc apply -f camel-k-pipeline-task-definition.yaml

https://camel.apache.org/camel-k/latest/_images/tekton/tekton-pipeline-definition.png

Step 5: Trigerring a Pipeline execution

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 https://camel.apache.org/camel-k/latest/_images/tekton/tekton-pipeline-run.png

After successfully build and deploy, you can find deployed apps on Topology https://camel.apache.org/camel-k/latest/_images/tekton/tekton-pipeline-result.png

Step 6 (Optional) : see your deployment using Tekton cli

$ 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

Source