-
Notifications
You must be signed in to change notification settings - Fork 350
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
5 changed files
with
93 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import org.apache.camel.builder.RouteBuilder; | ||
|
||
public class Consumer extends RouteBuilder { | ||
@Override | ||
public void configure() throws Exception { | ||
from("file:/tmp/log/example.log") | ||
.filter(simple("${exchangeProperty.CamelTimerCounter} == 10")); | ||
} | ||
} |
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,28 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import org.apache.camel.builder.RouteBuilder; | ||
|
||
public class Producer extends RouteBuilder { | ||
@Override | ||
public void configure() throws Exception { | ||
from("timer:tick") | ||
.setBody() | ||
.simple("Hello Camel K! #${exchangeProperty.CamelTimerCounter}") | ||
.log(""${body}""); | ||
} | ||
} |
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,17 @@ | ||
# Camel K Mount Trait | ||
|
||
|
||
In this section you will find examples about fine tuning your `Integration` using **Mount** `trait` capability. | ||
|
||
|
||
**Example 1: Mount Persistent Volume Claim on the Integration Pod in a Kubernetes platform (Static Volume Provisioning)** | ||
|
||
Requirement: Persistent Volume already created. | ||
|
||
Create the Pod and the Persistent Volume Claim: | ||
`kubectl apply -f pod-example.yaml` | ||
`kubectl apply -f pvc-example.yaml` | ||
|
||
Enable the Mount trait in the integrations, mount the Persistent Volume Claim in the Pod, and log to an external volume: | ||
`kamel run --trait mount.enabled=true --trait mount.volumes=["pvc-example:/tmp/log"] Producer.java -p quarkus.log.file.path=/tmp/log/example.log -p quarkus.log.file.enable=true` | ||
`kamel run --trait mount.enabled=true --trait mount.volumes=["pvc-example:/tmp/log"] Consumer.java` |
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,11 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod-example | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.14.2 | ||
volumeMounts: | ||
- mountPath: /tmp/log | ||
name: vm-example |
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,11 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: pvc-example | ||
spec: | ||
storageClassName: manual | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi |