From d3e78e6909953ff2fd1357e9d71f88603f43d192 Mon Sep 17 00:00:00 2001 From: Pierangelo Di Pilato Date: Tue, 12 Dec 2023 10:59:35 +0100 Subject: [PATCH 1/4] Add Red Hat Integration - Camel-k operator Signed-off-by: Pierangelo Di Pilato --- red-hat-camel-k/INFO.md | 46 +++++++++++++++++++ red-hat-camel-k/README.md | 38 +++++++++++++++ .../operator/base/kustomization.yaml | 7 +++ red-hat-camel-k/operator/base/namespace.yaml | 8 ++++ .../operator/base/operator-group.yaml | 5 ++ .../operator/base/subscription.yaml | 11 +++++ .../overlays/1.10.x/kustomization.yaml | 11 +++++ .../overlays/1.10.x/patch-channel.yaml | 3 ++ .../overlays/1.4.x/kustomization.yaml | 11 +++++ .../overlays/1.4.x/patch-channel.yaml | 3 ++ .../overlays/1.6.x/kustomization.yaml | 11 +++++ .../overlays/1.6.x/patch-channel.yaml | 3 ++ .../overlays/1.8.x/kustomization.yaml | 11 +++++ .../overlays/1.8.x/patch-channel.yaml | 3 ++ .../overlays/candidate/kustomization.yaml | 11 +++++ .../overlays/candidate/patch-channel.yaml | 3 ++ .../overlays/latest/kustomization.yaml | 11 +++++ .../overlays/latest/patch-channel.yaml | 3 ++ .../overlays/stable/kustomization.yaml | 11 +++++ .../overlays/stable/patch-channel.yaml | 3 ++ 20 files changed, 213 insertions(+) create mode 100644 red-hat-camel-k/INFO.md create mode 100644 red-hat-camel-k/README.md create mode 100644 red-hat-camel-k/operator/base/kustomization.yaml create mode 100644 red-hat-camel-k/operator/base/namespace.yaml create mode 100644 red-hat-camel-k/operator/base/operator-group.yaml create mode 100644 red-hat-camel-k/operator/base/subscription.yaml create mode 100644 red-hat-camel-k/operator/overlays/1.10.x/kustomization.yaml create mode 100644 red-hat-camel-k/operator/overlays/1.10.x/patch-channel.yaml create mode 100644 red-hat-camel-k/operator/overlays/1.4.x/kustomization.yaml create mode 100644 red-hat-camel-k/operator/overlays/1.4.x/patch-channel.yaml create mode 100644 red-hat-camel-k/operator/overlays/1.6.x/kustomization.yaml create mode 100644 red-hat-camel-k/operator/overlays/1.6.x/patch-channel.yaml create mode 100644 red-hat-camel-k/operator/overlays/1.8.x/kustomization.yaml create mode 100644 red-hat-camel-k/operator/overlays/1.8.x/patch-channel.yaml create mode 100644 red-hat-camel-k/operator/overlays/candidate/kustomization.yaml create mode 100644 red-hat-camel-k/operator/overlays/candidate/patch-channel.yaml create mode 100644 red-hat-camel-k/operator/overlays/latest/kustomization.yaml create mode 100644 red-hat-camel-k/operator/overlays/latest/patch-channel.yaml create mode 100644 red-hat-camel-k/operator/overlays/stable/kustomization.yaml create mode 100644 red-hat-camel-k/operator/overlays/stable/patch-channel.yaml diff --git a/red-hat-camel-k/INFO.md b/red-hat-camel-k/INFO.md new file mode 100644 index 00000000..d4b17505 --- /dev/null +++ b/red-hat-camel-k/INFO.md @@ -0,0 +1,46 @@ +# red-hat-camel-k + +Red Hat Integration - Camel K +============== + +**Red Hat Integration - Camel K** is a lightweight integration platform, born on Kubernetes, with serverless superpowers. + +## Installation + +To start using Camel K, install the operator and then create the following `IntegrationPlatform`: +``` +apiVersion: camel.apache.org/v1 +kind: IntegrationPlatform +metadata: + name: camel-k + labels: + app: "camel-k" +``` + +An `IntegrationPlatform` resource is automatically created by default, so you can skip this step. +Also, You can edit the `IntegrationPlatform`, to configure Camel K. +The configuration from the `IntegrationPlatform` will apply to the Camel integrations created in the same project. + +## Running an Integration + +After the initial setup, you can run a Camel integration on the cluster by creating an example `Integration`, e.g.: +``` +apiVersion: camel.apache.org/v1 +kind: Integration +metadata: + name: example +spec: + sources: + - name: Example.java + content: | + import org.apache.camel.builder.RouteBuilder; + + public class Example extends RouteBuilder { + @Override + public void configure() throws Exception { + from("timer:tick") + .setBody(constant("Hello World!")) + .to("log:info?skipBodyLineSeparator=false"); + } + } +``` diff --git a/red-hat-camel-k/README.md b/red-hat-camel-k/README.md new file mode 100644 index 00000000..c95b5cc6 --- /dev/null +++ b/red-hat-camel-k/README.md @@ -0,0 +1,38 @@ +# Red Hat Integration - Camel K + +Install Red Hat Integration - Camel K. + +Do not use the `base` directory directly, as you will need to patch the `channel` based on the version of OpenShift you are using, or the version of the operator you want to use. + +The current *overlays* available are for the following channels: + +* [1.10.x](operator/overlays/1.10.x) +* [1.4.x](operator/overlays/1.4.x) +* [1.6.x](operator/overlays/1.6.x) +* [1.8.x](operator/overlays/1.8.x) +* [candidate](operator/overlays/candidate) +* [latest](operator/overlays/latest) +* [stable](operator/overlays/stable) + +## Usage + +If you have cloned the `gitops-catalog` repository, you can install Red Hat Integration - Camel K based on the overlay of your choice by running from the root (`gitops-catalog`) directory. + +``` +oc apply -k red-hat-camel-k/operator/overlays/ +``` + +Or, without cloning: + +``` +oc apply -k https://github.com/redhat-cop/gitops-catalog/red-hat-camel-k/operator/overlays/ +``` + +As part of a different overlay in your own GitOps repo: + +``` +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - github.com/redhat-cop/gitops-catalog/red-hat-camel-k/operator/overlays/?ref=main +``` diff --git a/red-hat-camel-k/operator/base/kustomization.yaml b/red-hat-camel-k/operator/base/kustomization.yaml new file mode 100644 index 00000000..1e66bd5f --- /dev/null +++ b/red-hat-camel-k/operator/base/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - namespace.yaml + - operator-group.yaml + - subscription.yaml diff --git a/red-hat-camel-k/operator/base/namespace.yaml b/red-hat-camel-k/operator/base/namespace.yaml new file mode 100644 index 00000000..b27d8ed8 --- /dev/null +++ b/red-hat-camel-k/operator/base/namespace.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Namespace +metadata: + annotations: + openshift.io/display-name: "Red Hat Integration - Camel K" + labels: + openshift.io/cluster-monitoring: 'true' + name: red-hat-camel-k diff --git a/red-hat-camel-k/operator/base/operator-group.yaml b/red-hat-camel-k/operator/base/operator-group.yaml new file mode 100644 index 00000000..1baddcc3 --- /dev/null +++ b/red-hat-camel-k/operator/base/operator-group.yaml @@ -0,0 +1,5 @@ +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: red-hat-camel-k-group + namespace: red-hat-camel-k diff --git a/red-hat-camel-k/operator/base/subscription.yaml b/red-hat-camel-k/operator/base/subscription.yaml new file mode 100644 index 00000000..333f9de9 --- /dev/null +++ b/red-hat-camel-k/operator/base/subscription.yaml @@ -0,0 +1,11 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: red-hat-camel-k + namespace: red-hat-camel-k +spec: + channel: patch-me-see-overlays-dir + installPlanApproval: Automatic + name: red-hat-camel-k + source: redhat-operators + sourceNamespace: openshift-marketplace diff --git a/red-hat-camel-k/operator/overlays/1.10.x/kustomization.yaml b/red-hat-camel-k/operator/overlays/1.10.x/kustomization.yaml new file mode 100644 index 00000000..f5340419 --- /dev/null +++ b/red-hat-camel-k/operator/overlays/1.10.x/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Subscription + name: red-hat-camel-k + path: patch-channel.yaml diff --git a/red-hat-camel-k/operator/overlays/1.10.x/patch-channel.yaml b/red-hat-camel-k/operator/overlays/1.10.x/patch-channel.yaml new file mode 100644 index 00000000..f89f80bd --- /dev/null +++ b/red-hat-camel-k/operator/overlays/1.10.x/patch-channel.yaml @@ -0,0 +1,3 @@ +- op: replace + path: /spec/channel + value: 1.10.x diff --git a/red-hat-camel-k/operator/overlays/1.4.x/kustomization.yaml b/red-hat-camel-k/operator/overlays/1.4.x/kustomization.yaml new file mode 100644 index 00000000..f5340419 --- /dev/null +++ b/red-hat-camel-k/operator/overlays/1.4.x/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Subscription + name: red-hat-camel-k + path: patch-channel.yaml diff --git a/red-hat-camel-k/operator/overlays/1.4.x/patch-channel.yaml b/red-hat-camel-k/operator/overlays/1.4.x/patch-channel.yaml new file mode 100644 index 00000000..1b575559 --- /dev/null +++ b/red-hat-camel-k/operator/overlays/1.4.x/patch-channel.yaml @@ -0,0 +1,3 @@ +- op: replace + path: /spec/channel + value: 1.4.x diff --git a/red-hat-camel-k/operator/overlays/1.6.x/kustomization.yaml b/red-hat-camel-k/operator/overlays/1.6.x/kustomization.yaml new file mode 100644 index 00000000..f5340419 --- /dev/null +++ b/red-hat-camel-k/operator/overlays/1.6.x/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Subscription + name: red-hat-camel-k + path: patch-channel.yaml diff --git a/red-hat-camel-k/operator/overlays/1.6.x/patch-channel.yaml b/red-hat-camel-k/operator/overlays/1.6.x/patch-channel.yaml new file mode 100644 index 00000000..18f0e979 --- /dev/null +++ b/red-hat-camel-k/operator/overlays/1.6.x/patch-channel.yaml @@ -0,0 +1,3 @@ +- op: replace + path: /spec/channel + value: 1.6.x diff --git a/red-hat-camel-k/operator/overlays/1.8.x/kustomization.yaml b/red-hat-camel-k/operator/overlays/1.8.x/kustomization.yaml new file mode 100644 index 00000000..f5340419 --- /dev/null +++ b/red-hat-camel-k/operator/overlays/1.8.x/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Subscription + name: red-hat-camel-k + path: patch-channel.yaml diff --git a/red-hat-camel-k/operator/overlays/1.8.x/patch-channel.yaml b/red-hat-camel-k/operator/overlays/1.8.x/patch-channel.yaml new file mode 100644 index 00000000..f8e80bf2 --- /dev/null +++ b/red-hat-camel-k/operator/overlays/1.8.x/patch-channel.yaml @@ -0,0 +1,3 @@ +- op: replace + path: /spec/channel + value: 1.8.x diff --git a/red-hat-camel-k/operator/overlays/candidate/kustomization.yaml b/red-hat-camel-k/operator/overlays/candidate/kustomization.yaml new file mode 100644 index 00000000..f5340419 --- /dev/null +++ b/red-hat-camel-k/operator/overlays/candidate/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Subscription + name: red-hat-camel-k + path: patch-channel.yaml diff --git a/red-hat-camel-k/operator/overlays/candidate/patch-channel.yaml b/red-hat-camel-k/operator/overlays/candidate/patch-channel.yaml new file mode 100644 index 00000000..b2026269 --- /dev/null +++ b/red-hat-camel-k/operator/overlays/candidate/patch-channel.yaml @@ -0,0 +1,3 @@ +- op: replace + path: /spec/channel + value: candidate diff --git a/red-hat-camel-k/operator/overlays/latest/kustomization.yaml b/red-hat-camel-k/operator/overlays/latest/kustomization.yaml new file mode 100644 index 00000000..f5340419 --- /dev/null +++ b/red-hat-camel-k/operator/overlays/latest/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Subscription + name: red-hat-camel-k + path: patch-channel.yaml diff --git a/red-hat-camel-k/operator/overlays/latest/patch-channel.yaml b/red-hat-camel-k/operator/overlays/latest/patch-channel.yaml new file mode 100644 index 00000000..4d50d4b1 --- /dev/null +++ b/red-hat-camel-k/operator/overlays/latest/patch-channel.yaml @@ -0,0 +1,3 @@ +- op: replace + path: /spec/channel + value: latest diff --git a/red-hat-camel-k/operator/overlays/stable/kustomization.yaml b/red-hat-camel-k/operator/overlays/stable/kustomization.yaml new file mode 100644 index 00000000..f5340419 --- /dev/null +++ b/red-hat-camel-k/operator/overlays/stable/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + +patches: + - target: + kind: Subscription + name: red-hat-camel-k + path: patch-channel.yaml diff --git a/red-hat-camel-k/operator/overlays/stable/patch-channel.yaml b/red-hat-camel-k/operator/overlays/stable/patch-channel.yaml new file mode 100644 index 00000000..6642eb17 --- /dev/null +++ b/red-hat-camel-k/operator/overlays/stable/patch-channel.yaml @@ -0,0 +1,3 @@ +- op: replace + path: /spec/channel + value: stable From 1a93718e704fd710025f608776dfd040f931c427 Mon Sep 17 00:00:00 2001 From: Pierangelo Di Pilato Date: Tue, 12 Dec 2023 11:47:44 +0100 Subject: [PATCH 2/4] Add IntegrationPlatform instance Signed-off-by: Pierangelo Di Pilato --- .../instance/integration-platform/README.md | 39 +++++++++++++++++++ .../base/integration-platform.yaml | 6 +++ .../base/kustomization.yaml | 6 +++ .../overlays/default/kustomization.yaml | 6 +++ 4 files changed, 57 insertions(+) create mode 100644 red-hat-camel-k/instance/integration-platform/README.md create mode 100644 red-hat-camel-k/instance/integration-platform/base/integration-platform.yaml create mode 100644 red-hat-camel-k/instance/integration-platform/base/kustomization.yaml create mode 100644 red-hat-camel-k/instance/integration-platform/overlays/default/kustomization.yaml diff --git a/red-hat-camel-k/instance/integration-platform/README.md b/red-hat-camel-k/instance/integration-platform/README.md new file mode 100644 index 00000000..fe4217f1 --- /dev/null +++ b/red-hat-camel-k/instance/integration-platform/README.md @@ -0,0 +1,39 @@ +# OpenShift Serverless - Knative Eventing + +Installs the `IntegrationPlatform` of the Red Hat Integration - Camel-k Operator. + +## Prerequisites + +First, install the [Red Hat Integration - Camel-k Operator](../../operator) in your cluster. + +Do not use the `base` directory directly, as you will need to patch the `channel` based on the +version of OpenShift you are using, or the version of the operator you want to use. + +The current *overlays* available are: + +* [default](overlays/default) + +## Usage + +If you have cloned the `gitops-catalog` repository, you can install it by running from the +root `gitops-catalog` directory: + +``` +oc apply -k red-hat-camel-k/instance/integration-platform/overlays/default +``` + +Or, without cloning: + +``` +oc apply -k https://github.com/redhat-cop/gitops-catalog/red-hat-camel-k/instance/integration-platform/overlays/default +``` + +As part of a different overlay in your own GitOps repo: + +``` +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - github.com/redhat-cop/gitops-catalog/red-hat-camel-k/instance/integration-platform/overlays/default?ref=main +``` \ No newline at end of file diff --git a/red-hat-camel-k/instance/integration-platform/base/integration-platform.yaml b/red-hat-camel-k/instance/integration-platform/base/integration-platform.yaml new file mode 100644 index 00000000..7e6e5b6a --- /dev/null +++ b/red-hat-camel-k/instance/integration-platform/base/integration-platform.yaml @@ -0,0 +1,6 @@ +apiVersion: camel.apache.org/v1 +kind: IntegrationPlatform +metadata: + name: camel-k + labels: + app: "camel-k" \ No newline at end of file diff --git a/red-hat-camel-k/instance/integration-platform/base/kustomization.yaml b/red-hat-camel-k/instance/integration-platform/base/kustomization.yaml new file mode 100644 index 00000000..98bf44e4 --- /dev/null +++ b/red-hat-camel-k/instance/integration-platform/base/kustomization.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - integration-platform.yaml diff --git a/red-hat-camel-k/instance/integration-platform/overlays/default/kustomization.yaml b/red-hat-camel-k/instance/integration-platform/overlays/default/kustomization.yaml new file mode 100644 index 00000000..ef6e263c --- /dev/null +++ b/red-hat-camel-k/instance/integration-platform/overlays/default/kustomization.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base From 7481dbfdb3d67d0059ff4b7d476c8daa49daccd4 Mon Sep 17 00:00:00 2001 From: Pierangelo Di Pilato Date: Tue, 23 Jan 2024 11:59:33 +0100 Subject: [PATCH 3/4] Fix linter --- .../integration-platform/base/integration-platform.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/red-hat-camel-k/instance/integration-platform/base/integration-platform.yaml b/red-hat-camel-k/instance/integration-platform/base/integration-platform.yaml index 7e6e5b6a..95438e1d 100644 --- a/red-hat-camel-k/instance/integration-platform/base/integration-platform.yaml +++ b/red-hat-camel-k/instance/integration-platform/base/integration-platform.yaml @@ -3,4 +3,4 @@ kind: IntegrationPlatform metadata: name: camel-k labels: - app: "camel-k" \ No newline at end of file + app: "camel-k" From db81a5865c54f885d8da67e5b929ca172c039c34 Mon Sep 17 00:00:00 2001 From: Pierangelo Di Pilato Date: Tue, 23 Jan 2024 12:00:23 +0100 Subject: [PATCH 4/4] Delete rinstance directory --- .../instance/integration-platform/README.md | 39 ------------------- .../base/integration-platform.yaml | 6 --- .../base/kustomization.yaml | 6 --- .../overlays/default/kustomization.yaml | 6 --- 4 files changed, 57 deletions(-) delete mode 100644 red-hat-camel-k/instance/integration-platform/README.md delete mode 100644 red-hat-camel-k/instance/integration-platform/base/integration-platform.yaml delete mode 100644 red-hat-camel-k/instance/integration-platform/base/kustomization.yaml delete mode 100644 red-hat-camel-k/instance/integration-platform/overlays/default/kustomization.yaml diff --git a/red-hat-camel-k/instance/integration-platform/README.md b/red-hat-camel-k/instance/integration-platform/README.md deleted file mode 100644 index fe4217f1..00000000 --- a/red-hat-camel-k/instance/integration-platform/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# OpenShift Serverless - Knative Eventing - -Installs the `IntegrationPlatform` of the Red Hat Integration - Camel-k Operator. - -## Prerequisites - -First, install the [Red Hat Integration - Camel-k Operator](../../operator) in your cluster. - -Do not use the `base` directory directly, as you will need to patch the `channel` based on the -version of OpenShift you are using, or the version of the operator you want to use. - -The current *overlays* available are: - -* [default](overlays/default) - -## Usage - -If you have cloned the `gitops-catalog` repository, you can install it by running from the -root `gitops-catalog` directory: - -``` -oc apply -k red-hat-camel-k/instance/integration-platform/overlays/default -``` - -Or, without cloning: - -``` -oc apply -k https://github.com/redhat-cop/gitops-catalog/red-hat-camel-k/instance/integration-platform/overlays/default -``` - -As part of a different overlay in your own GitOps repo: - -``` -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - github.com/redhat-cop/gitops-catalog/red-hat-camel-k/instance/integration-platform/overlays/default?ref=main -``` \ No newline at end of file diff --git a/red-hat-camel-k/instance/integration-platform/base/integration-platform.yaml b/red-hat-camel-k/instance/integration-platform/base/integration-platform.yaml deleted file mode 100644 index 95438e1d..00000000 --- a/red-hat-camel-k/instance/integration-platform/base/integration-platform.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: camel.apache.org/v1 -kind: IntegrationPlatform -metadata: - name: camel-k - labels: - app: "camel-k" diff --git a/red-hat-camel-k/instance/integration-platform/base/kustomization.yaml b/red-hat-camel-k/instance/integration-platform/base/kustomization.yaml deleted file mode 100644 index 98bf44e4..00000000 --- a/red-hat-camel-k/instance/integration-platform/base/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - integration-platform.yaml diff --git a/red-hat-camel-k/instance/integration-platform/overlays/default/kustomization.yaml b/red-hat-camel-k/instance/integration-platform/overlays/default/kustomization.yaml deleted file mode 100644 index ef6e263c..00000000 --- a/red-hat-camel-k/instance/integration-platform/overlays/default/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: - - ../../base