You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/06/21 13:21:16 UTC

[camel-k] branch main updated (946d1d45e -> b0a0af7bc)

This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git


    from 946d1d45e chore: nightly SBOM refresh
     new b3b833fbc feat(cicd): onboard Camel K Tekton task
     new b0a0af7bc doc: tekton cicd

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 cicd/tekton/kamel-run/0.1/README.md                |  52 +++++
 cicd/tekton/kamel-run/0.1/kamel-run.yaml           |  56 +++++
 .../kamel-run/0.1/samples/run-external-build.yaml  | 106 +++++++++
 .../kamel-run/0.1/samples/run-operator-build.yaml  |  50 +++++
 .../kamel-run/0.1/support/camel-k-tekton.yaml      |  34 +++
 .../kamel-run/0.1/tests/pre-apply-task-hook.sh     |  10 +
 cicd/tekton/kamel-run/0.1/tests/resources.yaml     |  34 +++
 cicd/tekton/kamel-run/0.1/tests/run.yaml           |  76 +++++++
 docs/modules/ROOT/nav.adoc                         |   5 +-
 docs/modules/ROOT/pages/pipeline/tekton.adoc       |  60 ++++++
 .../ROOT/pages/tutorials/tekton/tekton.adoc        | 236 ---------------------
 docs/modules/ROOT/pages/tutorials/tutorials.adoc   |   8 -
 12 files changed, 481 insertions(+), 246 deletions(-)
 create mode 100644 cicd/tekton/kamel-run/0.1/README.md
 create mode 100644 cicd/tekton/kamel-run/0.1/kamel-run.yaml
 create mode 100644 cicd/tekton/kamel-run/0.1/samples/run-external-build.yaml
 create mode 100644 cicd/tekton/kamel-run/0.1/samples/run-operator-build.yaml
 create mode 100644 cicd/tekton/kamel-run/0.1/support/camel-k-tekton.yaml
 create mode 100755 cicd/tekton/kamel-run/0.1/tests/pre-apply-task-hook.sh
 create mode 100644 cicd/tekton/kamel-run/0.1/tests/resources.yaml
 create mode 100644 cicd/tekton/kamel-run/0.1/tests/run.yaml
 create mode 100644 docs/modules/ROOT/pages/pipeline/tekton.adoc
 delete mode 100644 docs/modules/ROOT/pages/tutorials/tekton/tekton.adoc
 delete mode 100644 docs/modules/ROOT/pages/tutorials/tutorials.adoc


[camel-k] 02/02: doc: tekton cicd

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit b0a0af7bcbb904187951a26c9f3fea2aa20bcce0
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Wed Jun 21 10:33:22 2023 +0200

    doc: tekton cicd
---
 docs/modules/ROOT/nav.adoc                         |   5 +-
 docs/modules/ROOT/pages/pipeline/tekton.adoc       |  60 ++++++
 .../ROOT/pages/tutorials/tekton/tekton.adoc        | 236 ---------------------
 docs/modules/ROOT/pages/tutorials/tutorials.adoc   |   8 -
 4 files changed, 63 insertions(+), 246 deletions(-)

diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index ff74541c5..e01203e34 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -35,7 +35,6 @@
 ** xref:running/local.adoc[Run Locally]
 ** xref:running/promoting.adoc[Promote an Integration]
 ** xref:running/knative-sink.adoc[Knative Sinks]
-** xref:tutorials/tutorials.adoc[Examples]
 * xref:configuration/configuration.adoc[Configuration]
 ** xref:configuration/build-time-properties.adoc[Build time properties]
 ** xref:configuration/components.adoc[Components]
@@ -43,7 +42,9 @@
 ** xref:configuration/runtime-properties.adoc[Properties]
 ** xref:configuration/runtime-config.adoc[Runtime configuration]
 ** xref:configuration/runtime-resources.adoc[Runtime resources]
-* xref:pipeline/pipeline.adoc[Pipeline]
+* Pipelines
+* xref:pipeline/pipeline.adoc[Basic]
+* xref:pipeline/tekton.adoc[Tekton]
 * Observability
 ** xref:observability/logging.adoc[Logging]
 *** xref:observability/logging/operator.adoc[Operator]
diff --git a/docs/modules/ROOT/pages/pipeline/tekton.adoc b/docs/modules/ROOT/pages/pipeline/tekton.adoc
new file mode 100644
index 000000000..cd62fc3f9
--- /dev/null
+++ b/docs/modules/ROOT/pages/pipeline/tekton.adoc
@@ -0,0 +1,60 @@
+[[full-fledged-pipeline]]
+= 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 xref:pipeline/pipeline.adoc[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 https://tekton.dev/[Tekton CICD].
+
+[[tekton-pipeline]]
+== Integrate with Tekton
+
+In Camel K version 2 we are supporting a Task which we're willing to include in https://hub.tekton.dev/[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
+
+```shell
+kubectl apply -f https://raw.githubusercontent.com/apache/camel-k/main/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 https://github.com/tektoncd/pipeline/blob/main/docs/workspaces.md[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:
+
+```shell
+kubectl apply -f  https://raw.githubusercontent.com/apache/camel-k/main/tekton/kamel-run/0.1/support/camel-k-tekton.yaml
+```
+
+[[tekton-pipeline-examples]]
+== Examples
+
+Here some examples that may resylt useful for your use case.
+
+=== Delegate build to operator
+
+Use the https://raw.githubusercontent.com/apache/camel-k/main/tekton/kamel-run/0.1/samples/run-operator-build.yaml[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 https://raw.githubusercontent.com/apache/camel-k/main/tekton/kamel-run/0.1/samples/run-external-build.yaml[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.
\ No newline at end of file
diff --git a/docs/modules/ROOT/pages/tutorials/tekton/tekton.adoc b/docs/modules/ROOT/pages/tutorials/tekton/tekton.adoc
deleted file mode 100644
index 31f520a09..000000000
--- a/docs/modules/ROOT/pages/tutorials/tekton/tekton.adoc
+++ /dev/null
@@ -1,236 +0,0 @@
-[[tutorials-tekton]]
-= Camel K in Tekton Pipelines
-
-[[tutorials-tekton-introduction]]
-== Introduction
-
-NOTE: Available from Camel K 1.8.0
-
-Camel K can be directly used in https://github.com/tektoncd/pipeline[Tekton Pipelines] tasks since it's container image ships the `kamel` CLI tool, that
-can be used to create all needed resources by interacting with the Kubernetes cluster.
-
-For example, the following Tekton pipeline task can be used to run an integration:
-
-[#camel-k-task-run-integration]
-[source,yaml]
-----
-apiVersion: tekton.dev/v1alpha1
-kind: Task
-metadata:
-  name: camel-k-run-integration
-spec:
-  inputs:
-    resources:
-      - name: repository
-        type: git
-    params:
-      - name: file
-        description: The integration file to run
-  steps:
-    - name: run-integration
-      image: docker.io/apache/camel-k:1.8.0 //<1>
-      workingDir: /workspace/repository
-      command:
-        - kamel
-      args:
-        - "run"
-        - "--wait"
-        - "$(inputs.params.file)" //<2>
-----
-
-
-<1> The base image for the step is `apache/camel-k:1.8.0`
-<2> It executes command `kamel run --wait ${inputs.params.file}`, with file to run received as parameter
-
-When executed, such task creates an integration resource from the given file (which is supposed to be contained in the input git repository) and waits for the integration to be fully running before completing.
-
-This task is a building block for more complex scenarios that can be composed in Tekton pipelines.
-If you want to learn more, just follow the remainder of the tutorial.
-
-[[tutorials-tekton-prerequisites]]
-== Prerequisites
-
-This tutorial assumes the following requirements are met:
-
-* OpenShift (or OKD) 4+ cluster (works also on "vanilla" Kubernetes with some adjustment) and `oc` binary tool
-* Tekton Pipelines 0.5.2 (different versions may need adjustments)
-* Camel K Client Tools 1.0.0-M2 (`kamel` binary tool)
-
-[[tutorials-tekton-cluster-setup]]
-== Cluster Setup
-
-This tutorial assumes that **Tekton Pipelines are already installed** in the cluster. Refer to the https://github.com/tektoncd/pipeline[Tekton documentation]
-to learn how to install them.
-
-Camel K cluster resources need to be installed on the cluster:
-
-[source,bash]
-----
-# Use the oc tool to login as cluster admin to the target cluster, then
-kamel install --cluster-setup
-----
-
-This will install the Camel K CRD (custom resource definitions) and roles to access them.
-You can switch to a standard user after doing this operation.
-
-[[tutorials-tekton-creating-the-pipeline]]
-== Creating the Pipeline
-
-We're going to create a pipeline on a new namespace. The first step is to create the namespace:
-
-[source,bash]
-----
-oc new-project camel-pipelines
-----
-
-=== Setting up a ServiceAccount
-
-Any running container that needs to interact with the Kubernetes API (in our case, to create deployment and integration resources) must
-have special permissions granted to its service account.
-
-Download the xref:attachment$tekton/camel-k-pipeline-permissions.yaml[camel-k-pipeline-permissions.yaml] file and save it into a directory in your hard drive.
-Then install it using the `oc` client tool:
-
-[source,bash]
-----
-oc apply -f camel-k-pipeline-permissions.yaml
-----
-
-This creates a https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/[Kubernetes ServiceAccount] named `camel-k-pipeline`
-that is authorized to create the same kind of resources that the Camel K operator needs to create. We'll use that service account to run our pipeline.
-
-=== Creating the Pipeline Definition
-
-Let's now create the pipeline definition. Download the xref:attachment$tekton/camel-k-pipeline-task-definition.yaml[camel-k-pipeline-task-definition.yaml] file
-and apply it to the cluster:
-
-[source,bash]
-----
-oc apply -f camel-k-pipeline-task-definition.yaml
-----
-
-This creates a series of resources, including a pipeline definition that you can immediately see on the OpenShift developer console.
-
-image::tekton/tekton-pipeline-definition.png[View of the Camel K Tekton pipeline in the OpenShift developer console]
-
-The pipeline just created is composed of two tasks.
-
-The last task (`camel-k-run-integration`) is the one we've <<camel-k-task-run-integration,already described in the introduction>>, while the first task just installs the operator in the current namespace.
-The definition of the first task is shown in the following excerpt:
-
-[source,yaml]
-----
-apiVersion: tekton.dev/v1alpha1
-kind: Task
-metadata:
-  name: camel-k-install-operator
-spec:
-  steps:
-    - name: install
-      image: docker.io/apache/camel-k:1.8.0
-      command:
-        - kamel
-      args:
-        - "install"
-        - "--skip-cluster-setup"
-----
-
-As you see, it's just doing a `kamel install --skip-cluster-setup` (we've already done the cluster setup in the <<tutorials-tekton-cluster-setup,preparation phase>>).
-
-
-Both tasks are executed in sequence in the pipeline that is shown below.
-
-[source,yaml]
-----
-apiVersion: tekton.dev/v1alpha1
-kind: Pipeline
-metadata:
-  name: camel-k-pipeline
-spec:
-  resources:
-    - name: source-repo
-      type: git
-  tasks:
-    - name: install-operator
-      taskRef:
-        name: camel-k-install-operator
-    - name: run-integration
-      runAfter: [install-operator]
-      taskRef:
-        name: camel-k-run-integration
-      resources:
-        inputs:
-          - name: repository
-            resource: source-repo
-      params:
-        - name: file
-          value: "examples/tekton/hello.groovy"
-----
-
-The integration file to be executed is set to `examples/tekton/hello.groovy` that is a simple "Hello World" integration contained in the Camel K
-github repository https://github.com/apache/camel-k/tree/main/example/tekton[example/tekton directory].
-
-In order to specify the actual source repository, the definition file contains also the following resource:
-
-[source,yaml]
-----
-apiVersion: tekton.dev/v1alpha1
-kind: PipelineResource
-metadata:
-  name: camel-k-examples-git
-spec:
-  type: git
-  params:
-    - name: revision
-      value: main
-    - name: url
-      value: https://github.com/apache/camel-k
-----
-
-The repo will be now used as input for the <<camel-k-task-run-integration,run-integration task>> in the pipeline.
-
-=== Triggering a Pipeline Execution
-
-Everything is now ready to be executed and the last thing missing is a trigger. Download the xref:attachment$tekton/camel-k-pipeline-task-run.yaml[camel-k-pipeline-task-run.yaml] file
-and apply it to the cluster:
-
-[source,bash]
-----
-oc apply -f camel-k-pipeline-task-run.yaml
-----
-
-The file contains only a PipelineRun resource:
-
-[source,yaml]
-----
-apiVersion: tekton.dev/v1alpha1
-kind: PipelineRun
-metadata:
-  name: camel-k-pipeline-run-1
-spec:
-  pipelineRef:
-    name: camel-k-pipeline
-  serviceAccount: 'camel-k-pipeline' //<1>
-  resources:
-    - name: source-repo
-      resourceRef:
-        name: camel-k-examples-git //<2>
-----
-
-<1> The PipelineRun binds the pipeline to the service account previously created
-<2> It also binds the pipeline to the Camel K repository containing the examples
-
-The creation of the file starts the execution of the pipeline and its progress can be monitored on the OpenShift developer console.
-
-image::tekton/tekton-pipeline-run.png[View of the Camel K Tekton pipeline execution in the OpenShift developer console]
-
-CAUTION: To execute the PipelineRun again, delete previous runs before re-applying
-
-The result of the pipeline execution is the Camel K operator and an integration named `hello` running on the cluster:
-
-image::tekton/tekton-pipeline-result.png[Result of the Camel K Tekton pipeline execution]
-
-There are certainly other ways to trigger an execution of a pipeline, like as reaction to a change in the git repository,
-but this is left to you as exercise ;)
-
-Refer to the https://github.com/tektoncd/pipeline[Tekton repository] for more information.
diff --git a/docs/modules/ROOT/pages/tutorials/tutorials.adoc b/docs/modules/ROOT/pages/tutorials/tutorials.adoc
deleted file mode 100644
index 935fb152e..000000000
--- a/docs/modules/ROOT/pages/tutorials/tutorials.adoc
+++ /dev/null
@@ -1,8 +0,0 @@
-[[tutorials]]
-= Camel K Tutorials
-
-The https://github.com/apache/camel-k-examples/tree/main/generic-examples[apache/camel-k-examples] repository contains a curated collection of
-tutorials that drives you from the basics of Camel K to more advanced features.
-
-NOTE: The xref:tutorials/tekton/tekton.adoc[Tekton Pipelines] example is still available here and it's going to be migrated to
-the https://github.com/apache/camel-k/tree/main/examples[apache/camel-k-examples] repository.


[camel-k] 01/02: feat(cicd): onboard Camel K Tekton task

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit b3b833fbca783d1644529ffbc3f3f7ff01823ef2
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Wed Jun 21 10:11:39 2023 +0200

    feat(cicd): onboard Camel K Tekton task
    
    While https://github.com/tektoncd/catalog/pull/1166 is on hold, we support it out of the official catalog
    
    Closes #3795
---
 cicd/tekton/kamel-run/0.1/README.md                |  52 ++++++++++
 cicd/tekton/kamel-run/0.1/kamel-run.yaml           |  56 +++++++++++
 .../kamel-run/0.1/samples/run-external-build.yaml  | 106 +++++++++++++++++++++
 .../kamel-run/0.1/samples/run-operator-build.yaml  |  50 ++++++++++
 .../kamel-run/0.1/support/camel-k-tekton.yaml      |  34 +++++++
 .../kamel-run/0.1/tests/pre-apply-task-hook.sh     |  10 ++
 cicd/tekton/kamel-run/0.1/tests/resources.yaml     |  34 +++++++
 cicd/tekton/kamel-run/0.1/tests/run.yaml           |  76 +++++++++++++++
 8 files changed, 418 insertions(+)

diff --git a/cicd/tekton/kamel-run/0.1/README.md b/cicd/tekton/kamel-run/0.1/README.md
new file mode 100644
index 000000000..afd098578
--- /dev/null
+++ b/cicd/tekton/kamel-run/0.1/README.md
@@ -0,0 +1,52 @@
+# Kamel run
+
+This Task creates and run a [Camel K](https://github.com/apache/camel-k) Integration.
+
+If you have installed Camel K operator, you can configure the `kamel-run` task the step to create the Integration that will be operated by Camel K. You can configure the parameter to delegate the build of your application to Camel K or do it as a part of previous pipelines steps.
+
+## Install the Task
+
+```shell
+kubectl apply -f https://raw.githubusercontent.com/apache/camel-k/main/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](https://github.com/tektoncd/pipeline/blob/main/docs/workspaces.md) 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:
+
+```shell
+kubectl apply -f  https://raw.githubusercontent.com/apache/camel-k/main/tekton/kamel-run/0.1/support/camel-k-tekton.yaml
+```
+
+### Delegate build to operator
+
+Use the [Tekton Camel K operator builder sample](../0.1/samples/run-operator-build.yaml) 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](../0.1/samples/run-external-build.yaml) 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.
\ No newline at end of file
diff --git a/cicd/tekton/kamel-run/0.1/kamel-run.yaml b/cicd/tekton/kamel-run/0.1/kamel-run.yaml
new file mode 100644
index 000000000..f6056c921
--- /dev/null
+++ b/cicd/tekton/kamel-run/0.1/kamel-run.yaml
@@ -0,0 +1,56 @@
+apiVersion: tekton.dev/v1beta1
+kind: Task
+metadata:
+  name: kamel-run
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/categories: Deployment
+    tekton.dev/pipelines.minVersion: "0.17.0"
+    tekton.dev/tags: cli
+    tekton.dev/platforms: "linux/amd64"
+    tekton.dev/displayName: "kamel run"
+spec:
+  description: >-
+    Run a Camel Integration
+
+    Kamel-run task creates a Camel K Integration which will be taken and operated by Camel K operator. You can either use this task to
+    run a build from source or build the application in previous tasks and use this last task to deploy and let Camel K operates it.
+  params:
+    - name: camel-k-image
+      description: The location of Camel K CLI image.
+      default: docker.io/apache/camel-k:1.12.0
+    - name: filename
+      description: the Integration source we want to run
+    - name: namespace
+      description: the namespace where to run the integration
+      default: ""
+    - name: container-image
+      description: the custom container image to use (if the build was performed as part of previous tasks)
+      default: ""
+    - name: wait
+      description: wait for the Integration to run before exiting the task
+      default: "false"
+  results:
+    - name: integration-name
+      description: The name of the integration created
+    - name: integration-phase
+      description: The phase of the integration created (when used with input `wait` parameter)
+  workspaces:
+  - name: source
+  steps:
+  - name: execute
+    image: $(params.camel-k-image)
+    workingDir: $(workspaces.source.path)
+    script: |
+      #!/usr/bin/env bash
+
+      KAMEL_RUN_ARGS="$(params.filename)"
+      [[ ! "$(params.namespace)" == "" ]] && KAMEL_RUN_ARGS="$KAMEL_RUN_ARGS -n $(params.namespace)"
+      [[ ! "$(params.container-image)" == "" ]] && KAMEL_RUN_ARGS="$KAMEL_RUN_ARGS -t container.image=$(params.container-image)"
+      [[ "$(params.wait)" == "true" ]] && KAMEL_RUN_ARGS="$KAMEL_RUN_ARGS --wait"
+      kamel_output=$(kamel run "$KAMEL_RUN_ARGS")
+      echo "$kamel_output"
+      # Let's use the output produced to scrape the integration name and phase
+      echo "$kamel_output" | grep -oP 'Integration ".*?" (updated|created|unchanged)' | awk -F ' ' '{print $2}' | sed "s/\"//g" | tr -d '\n' | tee "$(results.integration-name.path)"
+      kamel get "$(cat "$(results.integration-name.path)")" 2>/dev/null | tail -n +2 | awk -F ' ' '{print $2}' | tee "$(results.integration-phase.path)"
\ No newline at end of file
diff --git a/cicd/tekton/kamel-run/0.1/samples/run-external-build.yaml b/cicd/tekton/kamel-run/0.1/samples/run-external-build.yaml
new file mode 100644
index 000000000..14543a623
--- /dev/null
+++ b/cicd/tekton/kamel-run/0.1/samples/run-external-build.yaml
@@ -0,0 +1,106 @@
+---
+apiVersion: tekton.dev/v1beta1
+kind: Pipeline
+metadata:
+  name: external-build
+spec:
+  workspaces:
+  - name: shared-workspace
+  - name: maven-settings
+  tasks:
+  # Fetch git repo
+  - name: fetch-repository
+    taskRef:
+      name: git-clone
+    workspaces:
+    - name: output
+      workspace: shared-workspace
+    params:
+    - name: url
+      value: https://github.com/apache/camel-k-runtime
+  # Build the application
+  - name: maven-build
+    taskRef:
+      name: maven
+    runAfter:
+    - fetch-repository
+    workspaces:
+    - name: source
+      workspace: shared-workspace
+    - name: maven-settings
+      workspace: maven-settings
+    params:
+    - name: CONTEXT_DIR
+      value: "examples/yaml"
+    - name: GOALS
+      value:
+        - clean
+        - package
+  # Create the dockerfile (could be already in the git project, in such case, just skip this task)
+  - name: create-dockerfile
+    runAfter:
+    - maven-build
+    workspaces:
+    - name: source
+      workspace: shared-workspace
+    taskSpec:
+      steps:
+      - name: bash
+        image: ubuntu
+        script: |
+          echo "FROM docker.io/eclipse-temurin:17-jdk" > $(workspaces.source.path)/examples/yaml/Dockerfile
+          echo "COPY target/quarkus-app/ /deployments/dependencies/" >> $(workspaces.source.path)/examples/yaml/Dockerfile
+  # Build and push the container with the Camel application
+  - name: docker-build
+    taskRef:
+      name: buildah
+    runAfter:
+    - create-dockerfile
+    workspaces:
+    - name: source
+      workspace: shared-workspace
+    params:
+    - name: IMAGE
+      # Provide your container registry configuration accordingly!
+      value: 10.110.149.72/camel-k/my-camel-image
+    - name: TLSVERIFY
+      value: "false"
+    - name: CONTEXT
+      value: $(workspaces.source.path)/examples/yaml
+  # Run the Camel Integration, using the container image built previously
+  - name: kamel-run
+    taskRef:
+      name: kamel-run
+    runAfter:
+    - docker-build
+    workspaces:
+    - name: source
+      workspace: shared-workspace
+    params:
+    - name: filename
+      value: examples/yaml/data/routes.yaml
+    - name: container-image
+      value: $(tasks.docker-build.results.IMAGE_URL)
+
+---
+apiVersion: tekton.dev/v1beta1
+kind: PipelineRun
+metadata:
+  name: external-build-run
+spec:
+  pipelineRef:
+    name: external-build
+  taskRunSpecs:
+    - pipelineTaskName: kamel-run
+      taskServiceAccountName: camel-k-tekton
+  workspaces:
+  - name: shared-workspace
+    volumeClaimTemplate:
+      spec:
+        accessModes:
+        - ReadWriteOnce
+        resources:
+          requests:
+            storage: 1Gi
+  - name: maven-settings
+    emptyDir: {}
diff --git a/cicd/tekton/kamel-run/0.1/samples/run-operator-build.yaml b/cicd/tekton/kamel-run/0.1/samples/run-operator-build.yaml
new file mode 100644
index 000000000..57dd95817
--- /dev/null
+++ b/cicd/tekton/kamel-run/0.1/samples/run-operator-build.yaml
@@ -0,0 +1,50 @@
+---
+apiVersion: tekton.dev/v1beta1
+kind: Pipeline
+metadata:
+  name: operator-build
+spec:
+  workspaces:
+  - name: shared-workspace
+  tasks:
+  - name: fetch-repository
+    taskRef:
+      name: git-clone
+    workspaces:
+    - name: output
+      workspace: shared-workspace
+    params:
+    - name: url
+      value: https://github.com/apache/camel-k-examples/
+  - name: kamel-run
+    taskRef:
+      name: kamel-run
+    runAfter:
+    - fetch-repository
+    workspaces:
+    - name: source
+      workspace: shared-workspace
+    params:
+    - name: filename
+      value: generic-examples/languages/routes.yaml
+
+---
+apiVersion: tekton.dev/v1beta1
+kind: PipelineRun
+metadata:
+  name: operator-build-run
+spec:
+  pipelineRef:
+    name: operator-build
+  taskRunSpecs:
+    - pipelineTaskName: kamel-run
+      taskServiceAccountName: camel-k-tekton
+  workspaces:
+  - name: shared-workspace
+    volumeClaimTemplate:
+      spec:
+        accessModes:
+        - ReadWriteOnce
+        resources:
+          requests:
+            storage: 1Gi
diff --git a/cicd/tekton/kamel-run/0.1/support/camel-k-tekton.yaml b/cicd/tekton/kamel-run/0.1/support/camel-k-tekton.yaml
new file mode 100644
index 000000000..5aa8c6525
--- /dev/null
+++ b/cicd/tekton/kamel-run/0.1/support/camel-k-tekton.yaml
@@ -0,0 +1,34 @@
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: camel-k-tekton
+---
+kind: Role
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+  name: camel-k-integrations
+rules:
+- apiGroups:
+  - camel.apache.org
+  resources:
+  - integrations
+  verbs:
+  - create
+  - get
+  - list
+  - patch
+  - update
+  - watch
+---
+kind: RoleBinding
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+  name: camel-k-tekton-integrations
+subjects:
+- kind: ServiceAccount
+  name: camel-k-tekton
+roleRef:
+  kind: Role
+  name: camel-k-integrations
+  apiGroup: rbac.authorization.k8s.io
\ No newline at end of file
diff --git a/cicd/tekton/kamel-run/0.1/tests/pre-apply-task-hook.sh b/cicd/tekton/kamel-run/0.1/tests/pre-apply-task-hook.sh
new file mode 100755
index 000000000..1b7301847
--- /dev/null
+++ b/cicd/tekton/kamel-run/0.1/tests/pre-apply-task-hook.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+add_sidecar_registry ${TMPF}
+
+# Install Camel K operator
+wget https://github.com/apache/camel-k/releases/download/v1.12.0/camel-k-client-1.12.0-linux-64bit.tar.gz
+tar -xvf camel-k-client-1.12.0-linux-64bit.tar.gz
+./kamel install --registry localhost:5000 --registry-insecure --wait
+
+# Add git-clone
+add_task git-clone 0.7
\ No newline at end of file
diff --git a/cicd/tekton/kamel-run/0.1/tests/resources.yaml b/cicd/tekton/kamel-run/0.1/tests/resources.yaml
new file mode 100644
index 000000000..8c66baefb
--- /dev/null
+++ b/cicd/tekton/kamel-run/0.1/tests/resources.yaml
@@ -0,0 +1,34 @@
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: camel-k-tekton
+---
+kind: Role
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+  name: camel-k-integrations
+rules:
+- apiGroups:
+  - camel.apache.org
+  resources:
+  - integrations
+  verbs:
+  - create
+  - get
+  - list
+  - patch
+  - update
+  - watch
+---
+kind: RoleBinding
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+  name: camel-k-tekton-integrations
+subjects:
+- kind: ServiceAccount
+  name: camel-k-tekton
+roleRef:
+  kind: Role
+  name: camel-k-integrations
+  apiGroup: rbac.authorization.k8s.io
diff --git a/cicd/tekton/kamel-run/0.1/tests/run.yaml b/cicd/tekton/kamel-run/0.1/tests/run.yaml
new file mode 100644
index 000000000..b255be62b
--- /dev/null
+++ b/cicd/tekton/kamel-run/0.1/tests/run.yaml
@@ -0,0 +1,76 @@
+---
+apiVersion: tekton.dev/v1beta1
+kind: Pipeline
+metadata:
+  name: kamel-run-test
+spec:
+  workspaces:
+  - name: shared-workspace
+  tasks:
+  - name: fetch-repository
+    taskRef:
+      name: git-clone
+    workspaces:
+    - name: output
+      workspace: shared-workspace
+    params:
+    - name: url
+      value: https://github.com/apache/camel-k-examples/
+  - name: kamel-run
+    taskRef:
+      name: kamel-run
+    runAfter:
+    - fetch-repository
+    workspaces:
+    - name: source
+      workspace: shared-workspace
+    params:
+    - name: filename
+      value: generic-examples/languages/routes.yaml
+    - name: wait
+      value: "true"
+  - name: verify-it-phase
+    runAfter:
+    - kamel-run
+    params:
+    - name: it-name
+      value: $(tasks.kamel-run.results.integration-name)
+    - name: it-phase
+      value: $(tasks.kamel-run.results.integration-phase)
+    taskSpec:
+      params:
+      - name: it-name
+      - name: it-phase
+      steps:
+      - name: bash
+        image: ubuntu
+        script: |
+          if [[ ! $(params.it-name) == "sample"]]; then
+            echo "Expected integration name sample (was $(params.it-name))"
+            exit 1
+          fi
+          if [[ ! $(params.it-phase) == "running"]]; then
+            echo "Expected integration phase running (was $(params.it-phase))"
+            exit 1
+          fi
+
+---
+apiVersion: tekton.dev/v1beta1
+kind: PipelineRun
+metadata:
+  name: kamel-run-test-run
+spec:
+  pipelineRef:
+    name: kamel-run-test
+  taskRunSpecs:
+    - pipelineTaskName: kamel-run
+      taskServiceAccountName: camel-k-tekton
+  workspaces:
+  - name: shared-workspace
+    volumeClaimTemplate:
+      spec:
+        accessModes:
+        - ReadWriteOnce
+        resources:
+          requests:
+            storage: 1Gi