You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the file is shared between the containers you will need to provide a shared volume (an `EmtpyDir` in this case).
71
+
72
+
== An example sidecar container
73
+
74
+
Create an Integration which generate some values on a folder shared by the main Integration. This process is done by a `sidecar` container. The route takes care to read the files without knowing the process generating.
75
+
76
+
[source,yaml]
77
+
.route.yaml
78
+
----
79
+
- route:
80
+
from:
81
+
# Read a file that should have been initialized
82
+
# by the initContainer
83
+
uri: file:/tmp
84
+
parameters:
85
+
include: ^(sidecar).*
86
+
steps:
87
+
- log:
88
+
message: "${body}"
89
+
----
90
+
91
+
The route is agnostic how this file is generated.
92
+
93
+
When creating the Integration, then, it should include the sidecar container:
kamel run route.yaml -t mount.empty-dirs=common:/tmp -t init-containers.sidecar-tasks="sidecar;alpine;/bin/sh -c \"for i in $(seq 1 10); do echo helloSidecar$i > /tmp/sidecar_$i.txt; sleep 1; done\""
100
+
----
101
+
102
+
As the file is shared between the containers you will need to provide a shared volume (an `EmtpyDir` in this case). Mind that the sidecar container can be any other process embedded into a docker container: in this simple case we're creating a simple script to generate some content.
The above command would allow the execution of the JVM trait given that the user specify the path to the jar to execute.
75
79
76
-
== Other examples
80
+
== Jolokia agent configuration
81
+
82
+
You can use the `jvm.agents` configuration to run any given agent. Additionally you can use the other traits to expose any service provided by your agent. Take, as an example, the Jolokia JVM agent:
0 commit comments