Chapter 4. Kamelets reference
4.1. Kamelet structure Copy linkLink copied to clipboard!
A kamelet is typically coded in the YAML domain-specific language. The file name prefix is the name of the kamelet. For example, a kamelet with the name FTP sink has the filename ftp-sink.kamelet.yaml
.
Note that in OpenShift, a kamelet is a resource that shows the name of the kamelet (not the filename).
At a high level, a kamelet resource describes:
-
A metadata section containing the ID of the kamelet and other information, such as the type of kamelet (
source
,sink
, oraction
). - A definition (JSON-schema specification) that contains a set of parameters that you can use to configure the kamelet.
-
An optional
types
section containing information about input and output expected by the kamelet. - A Camel flow in YAML DSL that defines the implementation of the kamelet.
The following diagram shows an example of a kamelet and its parts.
Example kamelet structure
- The kamelet ID - Use this ID in Camel K integrations when you want to reference the kamelet.
- Annotations, such as icon, provide display features for the kamelet.
- Labels allow a user to query kamelets (for example, by kind: "source", "sink", or “action”)
- Description of the kamelet and parameters in JSON-schema specification format.
- The media type of the output (can include a schema).
- The route template that defines the behavior of the kamelet.
4.2. Example source kamelet Copy linkLink copied to clipboard!
Here is the content of the example coffee-source
kamelet:
4.3. Example sink kamelet Copy linkLink copied to clipboard!
Here is the content of the example log-sink
kamelet: