-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
105 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
# Camel K JVM Trait | ||
|
||
In this section you will find examples about fine tuning your `Integration` using **JVM** `trait` capability. | ||
In this section you will find examples about fine-tuning your `Integration` using **JVM** `trait` capability. | ||
|
||
Create a configmap holding a jar in order to simulate the presence of a dependency on the runtime image | ||
|
||
```shell | ||
kubectl create configmap my-dep --from-file=sample-1.0.jar | ||
``` | ||
|
||
Run the integration | ||
```shell | ||
kamel run --dev --resource configmap:my-dep --trait jvm.classpath=/etc/camel/resources/my-dep/sample-1.0.jar Classpath.java | ||
|
||
[1] 2024-06-07 09:17:06,422 INFO [route1] (Camel (camel-1) thread #1 - timer://tick) Hello World! | ||
[1] 2024-06-07 09:17:07,410 INFO [route1] (Camel (camel-1) thread #1 - timer://tick) Hello World! | ||
[1] 2024-06-07 09:17:08,410 INFO [route1] (Camel (camel-1) thread #1 - timer://tick) Hello World! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,34 @@ | ||
# Camel K Prometheus Trait | ||
|
||
In this section you will find examples about fine tuning your `Integration` using **Prometheus** `trait` capability. | ||
In this section you will find examples about fine-tuning your `Integration` using **Prometheus** `trait` capability. | ||
|
||
|
||
A Prometheus-compatible endpoint is configured with the Prometheus trait. When utilising the Prometheus operator, it also generates a PodMonitor resource, which allows the endpoint to be scraped automatically. | ||
A Prometheus-compatible endpoint is configured with the Prometheus trait. | ||
When utilising the Prometheus operator, it also generates a PodMonitor resource, which allows the endpoint to be scraped automatically. | ||
|
||
To get statistics about the number of events successfully handled by the `Integration`,execute the `MyIntegration.java` route via: | ||
|
||
$ kamel run -t prometheus.enabled=true MyIntegration.java | ||
In case the prometheus operator is not installed in your cluster, run: | ||
|
||
```shell | ||
kamel run --dev --trait prometheus.enabled=true --trait prometheus.pod-monitor=false MyIntegration.java | ||
``` | ||
|
||
In case the prometheus operator is not installed in your cluster, run: | ||
|
||
$ kamel run -t prometheus.enabled=true pod-monitor=false MyIntegration.java | ||
Alternatively, you can quickly deploy the Prometheus operator and then run: | ||
|
||
You should be able to see the new integration running after a while via: | ||
```shell | ||
kubectl create -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/bundle.yaml | ||
|
||
$ kamel get | ||
kamel run --dev --trait prometheus.enabled=true MyIntegration.java | ||
``` | ||
|
||
The metrics can be retrieved by port-forwarding this service, e.g.: | ||
|
||
$ kubectl port-forward svc/metrics-prometheus 8080:8080 | ||
```shell | ||
kubectl port-forward svc/prometheus-operator 8080:8080 | ||
|
||
$ curl http://localhost:8080/metrics | ||
curl http://localhost:8080/metrics | ||
``` | ||
|
||
Similarly other use cases can be to retrieve information on unprocessed events, number of retries made to process an event, etc. For more information on Integration monitoring refer to the [Camel K Integration Monitoring](https://camel.apache.org/camel-k/next/observability/monitoring/integration.html) documentation. | ||
Similarly other use cases can be to retrieve information on unprocessed events, number of retries made to process an event, etc. | ||
For more information on Integration monitoring refer to the [Camel K Integration Monitoring](https://camel.apache.org/camel-k/next/observability/monitoring/integration.html) documentation. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
# SERVICE EXAMPLE | ||
|
||
This folder contains examples of how to use a `trait service`. You can use them to learn more about how to enable services for integrations deployed on the cluster. | ||
This folder contains examples of how to use a trait `service`. You can use them to learn more about how to enable services for integrations deployed on the cluster. | ||
|
||
To access integration outside the cluster you can enable a nodePort when you deploy integration. An example is `./RestDSL.java.` | ||
|
||
You can also optionally decide to just go with the default clusterIP if you do not want your integration to be directly exposed to the outside world. An example of this use case is `./RestDSL2.java` | ||
To run this integrations use: | ||
```shell | ||
kamel run --dev --trait service.enabled=true --trait service.node-port=true RestDSL.java | ||
|
||
kubectl port-forward svc/rest-dsl 8080:80 | ||
curl http://localhost:8080/hello | ||
``` | ||
|
||
You can also optionally decide to just go with the default clusterIP if you do not want your integration to be directly exposed to the outside world. | ||
|
||
```shell | ||
kamel run --dev --trait service.enabled=true rest-dsl.yaml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# camel-k: language=yaml | ||
|
||
# --------------------------------------------------------------------------- | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# --------------------------------------------------------------------------- | ||
|
||
- from: | ||
uri: "rest:get:/hello" | ||
steps: | ||
- setBody: | ||
simple: "Hello World" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.