Full fledged Pipeline

If you’re running a production grade enterprise system, you likely want to use a full fledged CICD technology. The basic features provided by our homemade Pipeline may be definetely limited in such situation. For those production grade requirements we suggest to integrate one of the many CICD technologies around. One that we want to suggest and for which we provide an opinionated approach is Tekton CICD.

Integrate with Tekton

In Camel K version 2 we are supporting a Task which we’re willing to include in Tekton Hub. Here it follows the instructions and some example to show you how to adopt this technology togheter with Camel K. The prerequisite is to have Camel K and Tekton operators up and running. This brief guide requires certain previous familiarity with Tekton technology as well.

Install the Task

kubectl apply -f https://raw.githubusercontent.com/apache/camel-k/main/cicd/tekton/kamel-run/0.1/kamel-run.yaml

Parameters

  • camel-k-image: The name of the image containing the Kamel CLI (default: docker.io/apache/camel-k:1.12.0).

  • filename: the file containing the Integration source.

  • namespace: the namespace where to run the Integration (default: the task execution namespace).

  • container-image: the container image to use for this Integration. Useful when you want to build your own container for the Integration (default: empty, will trigger an Integration build).

  • wait: wait for the Integration to run before finishing the task. Useful when you want to get the integration-phase result (default: "false").

Workspaces

  • source: A Workspace containing the Integration source to run.

Results

  • integration-name: the Integration name which was created/updated.

  • integration-phase: the status of the Integration, tipycally used with wait: true input parameter.

Platforms

The Task can be run on linux/amd64 platform.

Usage

The Task can be used in several ways to accomodate the different build and deployment strategy you may have.

Create the Service Account

As we will do delegate the task, the creation of an Integration, we need to provide a ServiceAccount with the privileges required by the tasks:

kubectl apply -f  https://raw.githubusercontent.com/apache/camel-k/main/cicd/tekton/kamel-run/0.1/support/camel-k-tekton.yaml

Examples

Here some examples that may resylt useful for your use case.

Delegate build to operator

Use the Tekton Camel K operator builder sample in order to fetch a Git repository and run a Camel K Integration delegating the build to the Camel K operator.

Full pipeline with custom build

Use the Tekton Camel K external builder sample as a reference for a full pipeline where you define your own process of building the Camel application and using the kamel-run Task as last step in order to deploy the Integration and let Camel K operator managing it.