Skip to content

Commit

Permalink
Merge pull request #277 from pierDipi/add-camel-k
Browse files Browse the repository at this point in the history
Add Red Hat Integration - Camel K operator
  • Loading branch information
strangiato authored Jan 29, 2024
2 parents 0236380 + db81a58 commit 7fd3dfb
Show file tree
Hide file tree
Showing 20 changed files with 213 additions and 0 deletions.
46 changes: 46 additions & 0 deletions red-hat-camel-k/INFO.md
Original file line number Diff line number Diff line change
@@ -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");
}
}
```
38 changes: 38 additions & 0 deletions red-hat-camel-k/README.md
Original file line number Diff line number Diff line change
@@ -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/<channel>
```

Or, without cloning:

```
oc apply -k https://github.com/redhat-cop/gitops-catalog/red-hat-camel-k/operator/overlays/<channel>
```

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/<channel>?ref=main
```
7 changes: 7 additions & 0 deletions red-hat-camel-k/operator/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- namespace.yaml
- operator-group.yaml
- subscription.yaml
8 changes: 8 additions & 0 deletions red-hat-camel-k/operator/base/namespace.yaml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions red-hat-camel-k/operator/base/operator-group.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: red-hat-camel-k-group
namespace: red-hat-camel-k
11 changes: 11 additions & 0 deletions red-hat-camel-k/operator/base/subscription.yaml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions red-hat-camel-k/operator/overlays/1.10.x/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions red-hat-camel-k/operator/overlays/1.10.x/patch-channel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- op: replace
path: /spec/channel
value: 1.10.x
11 changes: 11 additions & 0 deletions red-hat-camel-k/operator/overlays/1.4.x/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions red-hat-camel-k/operator/overlays/1.4.x/patch-channel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- op: replace
path: /spec/channel
value: 1.4.x
11 changes: 11 additions & 0 deletions red-hat-camel-k/operator/overlays/1.6.x/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions red-hat-camel-k/operator/overlays/1.6.x/patch-channel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- op: replace
path: /spec/channel
value: 1.6.x
11 changes: 11 additions & 0 deletions red-hat-camel-k/operator/overlays/1.8.x/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions red-hat-camel-k/operator/overlays/1.8.x/patch-channel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- op: replace
path: /spec/channel
value: 1.8.x
11 changes: 11 additions & 0 deletions red-hat-camel-k/operator/overlays/candidate/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- op: replace
path: /spec/channel
value: candidate
11 changes: 11 additions & 0 deletions red-hat-camel-k/operator/overlays/latest/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions red-hat-camel-k/operator/overlays/latest/patch-channel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- op: replace
path: /spec/channel
value: latest
11 changes: 11 additions & 0 deletions red-hat-camel-k/operator/overlays/stable/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions red-hat-camel-k/operator/overlays/stable/patch-channel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- op: replace
path: /spec/channel
value: stable

0 comments on commit 7fd3dfb

Please sign in to comment.